-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node-v5.0.0-rc.1 can't work on Android L due to error: only position independent executables (PIE) are supported #3581
Comments
Can't you just set the standard |
I see flag settings in these file, and it seemed node-v5.0.0-rc.1 already considered PIE, but what's the problem to the end? 'conditions': [
['OS == "android"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}]
] ['(target_arch=="arm" or target_arch=="arm64" or target_arch=="x64" or target_arch=="ia32") and component!="shared_library"', {
'cflags': [
'-fPIE',
],
'ldflags': [
'-pie',
],
}], |
cc @evanlucas and @Gioyik maybe? |
I've fixed this issue by modified I added -fPIE for cflags and -pie for ldflags on Android. 'target_defaults': {
'default_configuration': 'Release',
'configurations': {
'Debug': {
'variables': {
'v8_enable_handle_zapping': 1,
},
'defines': [ 'DEBUG', '_DEBUG' ],
'cflags': [ '-g', '-O0' ],
'conditions': [
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64',
}],
['OS=="aix"', {
'cflags': [ '-gxcoff' ],
'ldflags': [ '-Wl,-bbigtoc' ],
}],
['OS == "android"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}]
],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
'Optimization': 0, # /Od, no optimization
'MinimalRebuild': 'false',
'OmitFramePointers': 'false',
'BasicRuntimeChecks': 3, # /RTC1
},
'VCLinkerTool': {
'LinkIncremental': 2, # enable incremental linking
},
},
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
},
},
'Release': {
'variables': {
'v8_enable_handle_zapping': 0,
},
'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
'conditions': [
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64',
}],
['OS=="solaris"', {
`# pull in V8's postmortem metadata`
'ldflags': [ '-Wl,-z,allextract' ]
}],
['OS!="mac" and OS!="win"', {
'cflags': [ '-fno-omit-frame-pointer' ],
}],
['OS == "android"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}]
], |
A pull request that updates common.gypi would be fine IMO. Please see CONTRIBUTING.md for details. |
Hey @kikijhu , I had the same problem with node v4.2.4, and it worked adding PIE flags as you said. Thanks! |
@IvanGaravito Glad to help you : ) |
I modified the solution. I add a flag cflag-pie in ./android-configure
Modify ./configure
Modify ./common.gypi
./config.gypi will contains the flag
|
@kikijhu Mind making a Pull Request for this? :D |
@bnoordhuis @Fishrock123 I'm behind the firewall in company, so can't pull code from github . Worse still, I can't even access github at home due to the firewall of China |
Is there an Android developer who wants to take this on? @kikijhu's changes look useful but no one on the core team develops on or for Android, as far as I'm aware. |
@bnoordhuis @kikijhu I was looking just for your answer. Works fine for me with node v4.4.0. Will test on node 5 & do a pull request as soon as possible. Thanks a lot =D |
I'm seeking some feedback about how Node.js is used on Android if anyone watching this thread would like to tell us about it: nodejs/build#359 |
Closing, we're building with |
issue description
I downloaded the latest node-v5.0.0-rc.1 and make it with Android NDK r10e, but it can’t work on Android L.
compile environment
error log
solution
I searched on Google for solution, found it, to add two flags in Android.mk.
But it seems node-v5.0.0-rc.1 just uses NDK toolchain, not use NDK to compile a executable file.
So how to add these two flags to node-v5.0.0-rc.1?
The text was updated successfully, but these errors were encountered: