David Kredba
2014-Mar-15 16:41 UTC
Gcc-4.9.0 trunk revision 208516 cannot compile openssh package with -flto
Hello, Could I please ask you for help? I opened a case in GCC Bugzilla and got reply that -fpie have to be used to get it compiled. Now it fails for me with: x86_64-pc-linux-gnu-gcc -o ssh ssh.o readconf.o clientloop.o sshtty.o sshconnect.o sshconnect1.o sshconnect2.o mux.o roaming_common.o roaming_client.o -L. -Lopenbsd-compat/ -flto=4 -fuse-linker-plugin -Wl,--as-needed -Wl,-O2 -Wl,-flto -O2 -ggdb -pipe -march=native -mtune=native -mno-3dnow -mno-sse4.2 -mno-avx -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -fstack-protector-strong -flto=4 -fuse-linker-plugin -Wl,--as-needed -Wl,-O2 -Wl,-flto -O2 -ggdb -pipe -march=native -mtune=native -mno-3dnow -mno-sse4.2 -mno-avx -pie -lssh -lopenbsd-compat -lssl -lcrypto -ldl -lutil -lz -lnsl -lcrypt -lresolv -lpthread umac.c:1193:3: warning: type of 'umac_ctx' does not match original declaration } umac_ctx; ^ ./umac.c:1193:3: note: previously declared here } umac_ctx; ^ /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0-alpha20140311/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/net-misc/openssh-6.5_p1-r1/temp/ccMU2kiP.ltrans0.ltrans.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /var/tmp/portage/net-misc/openssh-6.5_p1-r1/temp/ccMU2kiP.ltrans0.ltrans.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status Makefile:150: recipe for target 'ssh' failed make: *** [ssh] Error 1 ^[[31;01m*^[[0m ERROR: net-misc/openssh-6.5_p1-r1::gentoo failed (compile phase): ^[[31;01m*^[[0m emake failed gcc -v Using built-in specs. COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.0-alpha20140311/gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0-alpha20140311/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.9.0_alpha20140311/work/gcc-4.9-20140311/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.0-alpha20140311 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0-alpha20140311/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.0-alpha20140311 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.0-alpha20140311/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.0-alpha20140311/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0-alpha20140311/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.0-alpha20140311/python --enable-languages=c,c++,java,go,objc,obj-c++,fortran,ada --enable-obsolete --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.9.0_alpha20140311' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --disable-altivec --disable-fixed-point --enable-targets=all --enable-java-awt=gtk --enable-libgomp --enable-lto --with-cloog --disable-isl-version-check Thread model: posix gcc version 4.9.0-alpha20140311 20140312 (experimental) [trunk revision 208516] (Gentoo 4.9.0_alpha20140311) I am attaching config.log and build.log, both gzipped. Can this be checked by configure? Like if -flto* found then to use -fpie too? Thank you in advance. Best regards, David.
Damien Miller
2014-Mar-15 20:30 UTC
Gcc-4.9.0 trunk revision 208516 cannot compile openssh package with -flto
On Sat, 15 Mar 2014, David Kredba wrote:> Hello, > Could I please ask you for help? > > I opened a case in GCC Bugzilla and got reply that -fpie have to be > used to get it compiled. > > Now it fails for me with: > > x86_64-pc-linux-gnu-gcc -o ssh ssh.o readconf.o clientloop.o sshtty.o > sshconnect.o sshconnect1.o sshconnect2.o mux.o roaming_common.o > roaming_client.o -L. -Lopenbsd-compat/ -flto=4 -fuse-linker-plugin > -Wl,--as-needed -Wl,-O2 -Wl,-flto -O2 -ggdb -pipe -march=native > -mtune=native -mno-3dnow -mno-sse4.2 -mno-avx -Wl,-z,relro -Wl,-z,now > -Wl,-z,noexecstack -fstack-protector-strong -flto=4 > -fuse-linker-plugin -Wl,--as-needed -Wl,-O2 -Wl,-flto -O2 -ggdb -pipe > -march=native -mtune=native -mno-3dnow -mno-sse4.2 -mno-avx -pie -lssh > -lopenbsd-compat -lssl -lcrypto -ldl -lutil -lz -lnsl -lcrypt > -lresolv -lpthreadThere are a whole lot of options in here that were not added by OpenSSH's configure. If you are specifying CFLAGS then it is up to you to provide a coherent set.> I am attaching config.log and build.log, both gzipped.There were no attachments. The list software only accepts text attachments because of past incidents with spammers. If they are large then your best bet is to put them on a website somewhere (e.g. pastebin).> Can this be checked by configure? Like if -flto* found then to use -fpie too?We can't check every possible option provided by the user; the defaults are intended to work, but if you use others then you need to ensure they are coherent. -
Reasonably Related Threads
- [LLVMdev] gcc-4.8.1 -flto, error for visibility of LLVMX86CompilationCallback2?
- [LLVMdev] [PATCH] gcc-4.8.1 -flto, error for visibility of LLVMX86CompilationCallback2?
- Segmentation fault early in compilation of revision 85514
- [Dovecot-news] v2.2.30.1 released
- [Dovecot-news] v2.2.30.1 released