nodegit / nodegit/nodegit

Compilation error: "recompile with -fPIC "

Open
#1,494 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.8k
Forks
704
PR merge metrics
No merged PRs in 30d

Description

Hello there,

Thank you for making such an awesome library. I'm currently using nodegit on a project and tried without much success to build nodegit from termux on Android:

apt update
apt upgrade
apt install nodejs git
apt install g++ make python lib curl-dev openssl libssh
npm install nodegit

I ended up with this stacktrace:
/data/data/com.termux/files/usr/bin/ld: Release/obj.target/vendor/openssl/openssl.a(v3_extku.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol EXTENDED_KEY_USAGE_it' which may bind externally can not be used when making a shared object; recompile with -fPIC Release/obj.target/vendor/openssl/openssl.a(v3_extku.o): In function EXTENDED_KEY_USAGE_free': v3_extku.c:(.text+0x1bc): dangerous relocation: unsupported relocation clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [nodegit.target.mk:278: Release/obj.target/nodegit.node] Error 1 gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Linux 3.18.31-perf-g4ec23d9 gyp ERR! command "/data/data/com.termux/files/usr/bin/node" "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/data/data/com.termux/files/home/nuage/node_modules/nodegit/build/Release/nodegit.node" "--module_name=nodegit" "--module_path=/data/data/com.termux/files/home/nuage/node_modules/nodegit/build/Re

I'm not sure how I can recompile with -fPIC without editing some files coming from npm. Can you advise?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the npm install nodegit build on Termux/Android and inspect the generated nodegit.target.mk and node-gyp build output mentioned in the report. Determine which native dependency produces the non-PIC object, then verify that the build completes successfully on the reported environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, cpp, javascript, node.js
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.