-
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
libtool: unrecognized option -static
when building
#2341
Comments
I speculate that you have a libtool from e.g. homebrew on your path somewhere. |
Thanks for the reply! You are a correct, it was |
What happens if you are at 2.4.6? Do we need to downgrade? |
It seems odd that a macOS High Sierra
|
Any updates on this issue? I had to do some path gymnastics to get around this on my mac. OS: macOS High Sierra |
Wit MacPorts, this worked for me:
|
Had this error with my local MAMP setup. Does not work: Does work: I switched back and forth between the MAMP path and the usr/local/bin, works now with the MAMP path as well. If anyone can tell me why, I would highly appreciate it. |
try this
point to /usr/bin/libtool |
Thanks @zk4 . it works for me |
Thanks @zk4 . it works for me as well! |
Since I use neither macports or homebrew (I do my builds straight from source), I had to cook up something a little more homebrew; the end-product you see before you. A pair of liners that worked for me (should be done in the same shell context, tho, because it relies on the variable $CHANGED_FILES to keep the information; you could rework it to save to a file, too):
CHANGED_FILES=''; while [[ `which libtool` != '/usr/bin/libtool' ]] ; do ORIGINAL=`which libtool`; CHANGED_FILES="$CHANGED_FILES $ORIGINAL"; mv `which libtool` `which libtool`_hidden ; done
for file in $CHANGED_FILES ; do mv "$(dirname $file)/libtool_hidden" $file ; done |
@brycekahle Can this be reopened? This is still a valid issue from what I can tell. node-gyp should provide a fallback in the case where GNU libtool is in your PATH. In some cases GNU libtool needs to be in your PATH based on requirements from other packages. |
Actually this looks like it's more of a problem in chromium gyp. Unfortunately they don't have an issue tracker |
There's no need to reopen, it's working as expected. If you override the system libtool with something else, you had better make sure it's compatible. Ditto cc, ar, ld, etc. |
The problem is other tools expect libtool to be the GNU one. I guess you could say it’s an issue with those tools but it is much more common for the GNU libtool to be used and not the very obscure NeXTSTEP one. This kind of thing probably wouldn’t come up much in chromium’s use case, but is very very common when building multi language projects that include node bindings. I think this can be fixed very easily by falling back to |
It's the platform libtool. That's the opposite of obscure, it's the default. GYP does quite a bit of processing around libtool so I'm not inclined to accept patches that try to go on when it's not the expected version, that probably creates more issues down the road than it fixes, probably more subtle ones too. A patch that hard-codes the path to |
Thanks. It worked for me. |
Thanks @zk4 . it works for me as well! |
So wait it is 2021 and this is still an issue? I just tried today with 2.4.6 and got the same Can I regenerate the configure or something to get it to work with the GNU version? |
I had MAMP installed and MAMP binaries in my $PATH, including libtool:
Removing that fixed the issue. |
seems to be the case for me from 2.4.6_13 to 2.4.7_0 as well, deactivating libtool with macports works. |
which libtool
/usr/bin/libtool
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `-' in: --version
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
libtool --help
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `-' in: --help
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load] Preparing native dependencies: 0 / 1
› node-gyp failed to rebuild '/Users/linonetwo/Desktop/repo/TiddlyGit-Desktop/node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3'
◼ Running generateAssets hook
› TOUCH ba23eeee118cd63e16015df367567cb043fed872.intermediate
ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 ba23eeee118cd63e16015df367567cb043fed872.intermediate
TOUCH Release/obj.target/deps/locate_sqlite3.stamp
CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
LIBTOOL-STATIC Release/sqlite3.a
Usage: /opt/anaconda3/bin/libtool [OPTION]... [MODE-ARG]...
Try 'libtool --help' for more information.
libtool: error: unrecognised option: '-static'
make: *** [Release/sqlite3.a] Error 1
rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
Error: `make` failed with exit code: 2
at ChildProcess.onExit (/Users/linonetwo/Desktop/repo/TiddlyGit-Desktop/node_modules/.pnpm/node-gyp@9.3.1_bluebird@3.7.2/node_modules/node-gyp/lib/build.js:203:23)
at ChildProcess.emit (node:events:511:28)
at ChildProcess._handle.onexit (node:internal/child_process:293:12)
An unhandled rejection has occurred inside Forge:
Error: node-gyp failed to rebuild '/Users/linonetwo/Desktop/repo/TiddlyGit-Desktop/node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3'
at ChildProcess.<anonymous> (/Users/linonetwo/Desktop/repo/TiddlyGit-Desktop/node_modules/.pnpm/@electron+rebuild@3.2.13_bluebird@3.7.2/node_modules/@electron/rebuild/lib/module-type/node-gyp/node-gyp.js:118:24)
at ChildProcess.emit (node:events:511:28)
at ChildProcess._handle.onexit (node:internal/child_process:293:12)
ELIFECYCLE Command failed with exit code 1. #2341 (comment) is not working After uninstall anaconda3 and restart Mac, it still output the something, and try to use manually run |
For me uninstalling libtool via brew worked. |
Fresh clone and first attempt at building io.js, After running
./configure
andmake
, I encounter this error:Here is version information for my build environment:
Any help is much appreciated. Thanks!
The text was updated successfully, but these errors were encountered: