Skip to content
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

i686-linux-gnu-gcc: error: unrecognized command line option '-V' #372

Closed
SimonDanisch opened this issue Oct 10, 2018 · 10 comments
Closed

i686-linux-gnu-gcc: error: unrecognized command line option '-V' #372

SimonDanisch opened this issue Oct 10, 2018 · 10 comments

Comments

@SimonDanisch
Copy link
Member

Not sure if this is an issue with the environment or with ImageMagick:

configure:5173: $? = 0
configure:5162: /opt/i686-linux-gnu/bin/i686-linux-gnu-gcc -v >&5
Using built-in specs.
COLLECT_GCC=/opt/i686-linux-gnu/bin/i686-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/opt/i686-linux-gnu/bin/../libexec/gcc/i686-linux-gnu/4.8.5/lto-wrapper
Target: i686-linux-gnu
Configured with: /workspace/srcdir/gcc-4.8.5/configure --prefix=/workspace/destdir --target=i686-linux-gnu --host=x86_64-linux-gnu --build=x86_64-linux-gnu --disable-multilib --disable-werror --disable-bootstrap --enable-host-shared --enable-threads=posix --with-sysroot=/workspace/destdir/i686-linux-gnu/sys-root --enable-languages=c,c++,fortran,objc,obj-c++
Thread model: posix
gcc version 4.8.5 (GCC) 
configure:5173: $? = 0
configure:5162: /opt/i686-linux-gnu/bin/i686-linux-gnu-gcc -V >&5
i686-linux-gnu-gcc: error: unrecognized command line option '-V'
i686-linux-gnu-gcc: fatal error: no input files
compilation terminated.

Full log:
https://gist.github.com/SimonDanisch/fb87d53ce5efd1409168c53c73c6e6b9#file-config-log

@staticfloat
Copy link
Member

Good job on the full log; that error isn't the problem, (configure runs a bunch of commands that causes gcc to fail because it's searching for how to pass proper options to it) it's actually the one farther down:

configure:5193: checking whether the C compiler works
configure:5215: /opt/i686-linux-gnu/bin/i686-linux-gnu-gcc   -all-static conftest.c  >&5
i686-linux-gnu-gcc: error: unrecognized command line option '-all-static'
configure:5219: $? = 1
configure:5257: result: no

I'm not sure why it's trying to pass -all-static; I don't think that's a GCC option.

@leo60228
Copy link

This is a buggy interaction between libtool and autoconf. A workaround was discussed in 2004(!) but I don't believe it was ever implemented. The suggested solution was to run ./configure LDFLAGS=-static; make LDFLAGS=-all-static. I don't know how to implement that in BinaryBuilder, though.

@leo60228
Copy link

Horrible hack solution:

#!/bin/sh
WRAPPED_BIN="gcc"
ARGS=("$@")
ARGS=("${ARGS[@]/#-all-static/-static}")
ARGS=("${ARGS[@]/-V}")
"$WRAPPED_BIN" "${ARGS[@]}"

@staticfloat
Copy link
Member

Why not just do the ./configure LDFLAGS=-static; make LDFLAGS=-all-static in the builder repository?

@leo60228
Copy link

...because I'm an idiot sorry. I'll see if BinaryBuilder works on NixOS first, though. Not sure how to setup Travis on a fork.

@leo60228
Copy link

Wait a second. ImageMagickBuilder explicitly specifies -all-static. Why is it doing this? How did this ever work?

@staticfloat
Copy link
Member

If I had a nickel for every time I thought that to myself.......

I'll try running it locally without that. Looks like it's a very recent commit that Simon added to try and fix Windows: JuliaIO/ImageMagickBuilder@22377e5

@leo60228
Copy link

Wait, there's already a PR for this. Hm. JuliaIO/ImageMagickBuilder#5

@staticfloat
Copy link
Member

Confirmed that removing that LDFLAGS export fixes this.

@SimonDanisch
Copy link
Member Author

Sorry about this, I just copy & pasted that flag from the imagemagick forums and messed up when trying to make sense of the error log....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants