NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/55594: Error creating shared library using gcc-7.5.0 on NetBSD 9.0_STABLE



The following reply was made to PR toolchain/55594; it has been noted by GNATS.

From: "Rajeev V. Pillai" <rajeev_v_pillai%yahoo.com@localhost>
To: "toolchain-manager%netbsd.org@localhost" <toolchain-manager%netbsd.org@localhost>, 
	"gnats-admin%netbsd.org@localhost" <gnats-admin%netbsd.org@localhost>, 
	"netbsd-bugs%netbsd.org@localhost" <netbsd-bugs%netbsd.org@localhost>, 
	"gnats-bugs%netbsd.org@localhost" <gnats-bugs%netbsd.org@localhost>
Cc: 
Subject: Re: toolchain/55594: Error creating shared library using gcc-7.5.0
 on NetBSD 9.0_STABLE
Date: Thu, 20 Aug 2020 11:44:56 +0000 (UTC)

  On Thursday, 20 August 2020, 16:40:03 GMT+5:30, Joerg Sonnenberger <joerg@=
 bec.de> wrote:
 
 > Why are you using -pie for a shared library?
 
 That's a default (and has been removed), and not relevant here, I think.
 There seems to be a difference between passing ``-Wl,-shared'' and passing =
 ``-shared'':
 With ``-shared'', the library is produced without error:
 
 ---OUTPUT STARTS---
 $ gcc -v -Wall -O2 -fstack-protector-all -fstack-protector-strong -march=3D=
 native -pipe -shared -o ../lib/libtinfow.so ../obj_s/access.o=C2=A0=C2=A0..=
 /obj_s/add_tries.o=C2=A0=C2=A0../obj_s/alloc_ttype.o=C2=A0=C2=A0../obj_s/co=
 des.o=C2=A0=C2=A0../obj_s/comp_captab.o=C2=A0=C2=A0../obj_s/comp_error.o=C2=
 =A0=C2=A0../obj_s/comp_hash.o=C2=A0=C2=A0../obj_s/comp_userdefs.o=C2=A0=C2=
 =A0../obj_s/db_iterator.o=C2=A0=C2=A0../obj_s/doalloc.o=C2=A0=C2=A0../obj_s=
 /entries.o=C2=A0=C2=A0../obj_s/fallback.o=C2=A0=C2=A0../obj_s/free_ttype.o=
 =C2=A0=C2=A0../obj_s/getenv_num.o=C2=A0=C2=A0../obj_s/home_terminfo.o=C2=A0=
 =C2=A0../obj_s/init_keytry.o=C2=A0=C2=A0../obj_s/lib_acs.o=C2=A0=C2=A0../ob=
 j_s/lib_baudrate.o=C2=A0=C2=A0../obj_s/lib_cur_term.o=C2=A0=C2=A0../obj_s/l=
 ib_data.o=C2=A0=C2=A0../obj_s/lib_has_cap.o=C2=A0=C2=A0../obj_s/lib_kernel.=
 o=C2=A0=C2=A0../obj_s/lib_keyname.o=C2=A0=C2=A0../obj_s/lib_longname.o=C2=
 =A0=C2=A0../obj_s/lib_napms.o=C2=A0=C2=A0../obj_s/lib_options.o=C2=A0=C2=A0=
 ../obj_s/lib_raw.o=C2=A0=C2=A0../obj_s/lib_setup.o=C2=A0=C2=A0../obj_s/lib_=
 termcap.o=C2=A0=C2=A0../obj_s/lib_termname.o=C2=A0=C2=A0../obj_s/lib_tgoto.=
 o=C2=A0=C2=A0../obj_s/lib_ti.o=C2=A0=C2=A0../obj_s/lib_tparm.o=C2=A0=C2=A0.=
 ./obj_s/lib_tputs.o=C2=A0=C2=A0../obj_s/lib_trace.o=C2=A0=C2=A0../obj_s/lib=
 _ttyflags.o=C2=A0=C2=A0../obj_s/lib_twait.o=C2=A0=C2=A0../obj_s/name_match.=
 o=C2=A0=C2=A0../obj_s/names.o=C2=A0=C2=A0../obj_s/obsolete.o=C2=A0=C2=A0../=
 obj_s/read_entry.o=C2=A0=C2=A0../obj_s/read_termcap.o=C2=A0=C2=A0../obj_s/s=
 trings.o=C2=A0=C2=A0../obj_s/tries.o=C2=A0=C2=A0../obj_s/trim_sgr0.o=C2=A0=
 =C2=A0../obj_s/unctrl.o=C2=A0=C2=A0../obj_s/visbuf.o=C2=A0=C2=A0../obj_s/al=
 loc_entry.o=C2=A0=C2=A0../obj_s/captoinfo.o=C2=A0=C2=A0../obj_s/comp_expand=
 .o=C2=A0=C2=A0../obj_s/comp_parse.o=C2=A0=C2=A0../obj_s/comp_scan.o=C2=A0=
 =C2=A0../obj_s/parse_entry.o=C2=A0=C2=A0../obj_s/write_entry.o=C2=A0=C2=A0.=
 ./obj_s/define_key.o=C2=A0=C2=A0../obj_s/hashed_db.o=C2=A0=C2=A0../obj_s/ke=
 y_defined.o=C2=A0=C2=A0../obj_s/keybound.o=C2=A0=C2=A0../obj_s/keyok.o=C2=
 =A0=C2=A0../obj_s/version.o -L../lib 2>&1 | tee ~/work/log-ok.txt
 Using built-in specs.
 COLLECT_GCC=3Dgcc
 COLLECT_LTO_WRAPPER=3D/usr/libexec/lto-wrapper
 Target: x86_64--netbsd
 Configured with: /usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure =
 --target=3Dx86_64--netbsd --enable-long-long --enable-threads --with-bugurl=
 =3Dhttp://www.NetBSD.org/Misc/send-pr.html --with-pkgversion=3D'NetBSD nb4 =
 20200810' --with-system-zlib --without-isl --enable-__cxa_atexit --enable-l=
 ibstdcxx-time=3Drt --enable-libstdcxx-threads --with-diagnostics-color=3Dau=
 to-if-env --with-tune=3Dnocona --with-default-libstdcxx-abi=3Dnew --with-mp=
 c-lib=3D/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpc/lib/libmp=
 c --with-mpfr-lib=3D/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/m=
 pfr/lib/libmpfr --with-gmp-lib=3D/var/obj/mknative/amd64-x86_64/usr/src/ext=
 ernal/lgpl3/gmp/lib/libgmp --with-mpc-include=3D/usr/src/external/lgpl3/mpc=
 /dist/src --with-mpfr-include=3D/usr/src/external/lgpl3/mpfr/dist/src --wit=
 h-gmp-include=3D/usr/src/external/lgpl3/gmp/lib/libgmp/arch/x86_64 --enable=
 -tls --disable-multilib --disable-libstdcxx-pch --build=3Dx86_64--netbsd --=
 host=3Dx86_64--netbsd --with-sysroot=3D/var/obj/mknative/amd64-x86_64/usr/s=
 rc/destdir.amd64
 Thread model: posix
 gcc version 7.5.0 (nb4 20200810)=20
 COMPILER_PATH=3D/usr/libexec/
 LIBRARY_PATH=3D/usr/lib/
 COLLECT_GCC_OPTIONS=3D'-v' '-Wall' '-O2' '-fstack-protector-all' '-fstack-p=
 rotector-strong' '-march=3Dnative' '-pipe' '-shared' '-o' '../lib/libtinfow=
 .so' '-L../lib'
 ld -plugin /usr/libexec/liblto_plugin.so -plugin-opt=3D/usr/libexec/lto-wra=
 pper -plugin-opt=3D-fresolution=3D/tmp//cchMdIl3.res -plugin-opt=3D-pass-th=
 rough=3D-lgcc_s -plugin-opt=3D-pass-through=3D-lgcc -plugin-opt=3D-pass-thr=
 ough=3D-lc -plugin-opt=3D-pass-through=3D-lgcc_s -plugin-opt=3D-pass-throug=
 h=3D-lgcc --eh-frame-hdr -shared -o ../lib/libtinfow.so /usr/lib/crti.o /us=
 r/lib/crtbeginS.o -L../lib ../obj_s/access.o ../obj_s/add_tries.o ../obj_s/=
 alloc_ttype.o ../obj_s/codes.o ../obj_s/comp_captab.o ../obj_s/comp_error.o=
  ../obj_s/comp_hash.o ../obj_s/comp_userdefs.o ../obj_s/db_iterator.o ../ob=
 j_s/doalloc.o ../obj_s/entries.o ../obj_s/fallback.o ../obj_s/free_ttype.o =
 ../obj_s/getenv_num.o ../obj_s/home_terminfo.o ../obj_s/init_keytry.o ../ob=
 j_s/lib_acs.o ../obj_s/lib_baudrate.o ../obj_s/lib_cur_term.o ../obj_s/lib_=
 data.o ../obj_s/lib_has_cap.o ../obj_s/lib_kernel.o ../obj_s/lib_keyname.o =
 ../obj_s/lib_longname.o ../obj_s/lib_napms.o ../obj_s/lib_options.o ../obj_=
 s/lib_raw.o ../obj_s/lib_setup.o ../obj_s/lib_termcap.o ../obj_s/lib_termna=
 me.o ../obj_s/lib_tgoto.o ../obj_s/lib_ti.o ../obj_s/lib_tparm.o ../obj_s/l=
 ib_tputs.o ../obj_s/lib_trace.o ../obj_s/lib_ttyflags.o ../obj_s/lib_twait.=
 o ../obj_s/name_match.o ../obj_s/names.o ../obj_s/obsolete.o ../obj_s/read_=
 entry.o ../obj_s/read_termcap.o ../obj_s/strings.o ../obj_s/tries.o ../obj_=
 s/trim_sgr0.o ../obj_s/unctrl.o ../obj_s/visbuf.o ../obj_s/alloc_entry.o ..=
 /obj_s/captoinfo.o ../obj_s/comp_expand.o ../obj_s/comp_parse.o ../obj_s/co=
 mp_scan.o ../obj_s/parse_entry.o ../obj_s/write_entry.o ../obj_s/define_key=
 .o ../obj_s/hashed_db.o ../obj_s/key_defined.o ../obj_s/keybound.o ../obj_s=
 /keyok.o ../obj_s/version.o --as-needed -lgcc_s --no-as-needed -lgcc -lc --=
 as-needed -lgcc_s --no-as-needed -lgcc /usr/lib/crtendS.o /usr/lib/crtn.o
 COLLECT_GCC_OPTIONS=3D'-v' '-Wall' '-O2' '-fstack-protector-all' '-fstack-p=
 rotector-strong' '-march=3Dnative' '-pipe' '-shared' '-o' '../lib/libtinfow=
 .so' '-L../lib'
 ---OUTPUT ENDS---
 
 
 With ``-Wl,-shared'', there is an error (it's trying to create an executabl=
 e):
 ---OUTPUT STARTS---
 $ gcc -v -Wall -O2 -fstack-protector-all -fstack-protector-strong -march=3D=
 native -pipe -Wl,-shared -o ../lib/libtinfow.so ../obj_s/access.o=C2=A0=C2=
 =A0../obj_s/add_tries.o=C2=A0=C2=A0../obj_s/alloc_ttype.o=C2=A0=C2=A0../obj=
 _s/codes.o=C2=A0=C2=A0../obj_s/comp_captab.o=C2=A0=C2=A0../obj_s/comp_error=
 .o=C2=A0=C2=A0../obj_s/comp_hash.o=C2=A0=C2=A0../obj_s/comp_userdefs.o=C2=
 =A0=C2=A0../obj_s/db_iterator.o=C2=A0=C2=A0../obj_s/doalloc.o=C2=A0=C2=A0..=
 /obj_s/entries.o=C2=A0=C2=A0../obj_s/fallback.o=C2=A0=C2=A0../obj_s/free_tt=
 ype.o=C2=A0=C2=A0../obj_s/getenv_num.o=C2=A0=C2=A0../obj_s/home_terminfo.o=
 =C2=A0=C2=A0../obj_s/init_keytry.o=C2=A0=C2=A0../obj_s/lib_acs.o=C2=A0=C2=
 =A0../obj_s/lib_baudrate.o=C2=A0=C2=A0../obj_s/lib_cur_term.o=C2=A0=C2=A0..=
 /obj_s/lib_data.o=C2=A0=C2=A0../obj_s/lib_has_cap.o=C2=A0=C2=A0../obj_s/lib=
 _kernel.o=C2=A0=C2=A0../obj_s/lib_keyname.o=C2=A0=C2=A0../obj_s/lib_longnam=
 e.o=C2=A0=C2=A0../obj_s/lib_napms.o=C2=A0=C2=A0../obj_s/lib_options.o=C2=A0=
 =C2=A0../obj_s/lib_raw.o=C2=A0=C2=A0../obj_s/lib_setup.o=C2=A0=C2=A0../obj_=
 s/lib_termcap.o=C2=A0=C2=A0../obj_s/lib_termname.o=C2=A0=C2=A0../obj_s/lib_=
 tgoto.o=C2=A0=C2=A0../obj_s/lib_ti.o=C2=A0=C2=A0../obj_s/lib_tparm.o=C2=A0=
 =C2=A0../obj_s/lib_tputs.o=C2=A0=C2=A0../obj_s/lib_trace.o=C2=A0=C2=A0../ob=
 j_s/lib_ttyflags.o=C2=A0=C2=A0../obj_s/lib_twait.o=C2=A0=C2=A0../obj_s/name=
 _match.o=C2=A0=C2=A0../obj_s/names.o=C2=A0=C2=A0../obj_s/obsolete.o=C2=A0=
 =C2=A0../obj_s/read_entry.o=C2=A0=C2=A0../obj_s/read_termcap.o=C2=A0=C2=A0.=
 ./obj_s/strings.o=C2=A0=C2=A0../obj_s/tries.o=C2=A0=C2=A0../obj_s/trim_sgr0=
 .o=C2=A0=C2=A0../obj_s/unctrl.o=C2=A0=C2=A0../obj_s/visbuf.o=C2=A0=C2=A0../=
 obj_s/alloc_entry.o=C2=A0=C2=A0../obj_s/captoinfo.o=C2=A0=C2=A0../obj_s/com=
 p_expand.o=C2=A0=C2=A0../obj_s/comp_parse.o=C2=A0=C2=A0../obj_s/comp_scan.o=
 =C2=A0=C2=A0../obj_s/parse_entry.o=C2=A0=C2=A0../obj_s/write_entry.o=C2=A0=
 =C2=A0../obj_s/define_key.o=C2=A0=C2=A0../obj_s/hashed_db.o=C2=A0=C2=A0../o=
 bj_s/key_defined.o=C2=A0=C2=A0../obj_s/keybound.o=C2=A0=C2=A0../obj_s/keyok=
 .o=C2=A0=C2=A0../obj_s/version.o -L../lib 2>&1 | tee ~/work/log-fail.txt
 Using built-in specs.
 COLLECT_GCC=3Dgcc
 COLLECT_LTO_WRAPPER=3D/usr/libexec/lto-wrapper
 Target: x86_64--netbsd
 Configured with: /usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure =
 --target=3Dx86_64--netbsd --enable-long-long --enable-threads --with-bugurl=
 =3Dhttp://www.NetBSD.org/Misc/send-pr.html --with-pkgversion=3D'NetBSD nb4 =
 20200810' --with-system-zlib --without-isl --enable-__cxa_atexit --enable-l=
 ibstdcxx-time=3Drt --enable-libstdcxx-threads --with-diagnostics-color=3Dau=
 to-if-env --with-tune=3Dnocona --with-default-libstdcxx-abi=3Dnew --with-mp=
 c-lib=3D/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpc/lib/libmp=
 c --with-mpfr-lib=3D/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/m=
 pfr/lib/libmpfr --with-gmp-lib=3D/var/obj/mknative/amd64-x86_64/usr/src/ext=
 ernal/lgpl3/gmp/lib/libgmp --with-mpc-include=3D/usr/src/external/lgpl3/mpc=
 /dist/src --with-mpfr-include=3D/usr/src/external/lgpl3/mpfr/dist/src --wit=
 h-gmp-include=3D/usr/src/external/lgpl3/gmp/lib/libgmp/arch/x86_64 --enable=
 -tls --disable-multilib --disable-libstdcxx-pch --build=3Dx86_64--netbsd --=
 host=3Dx86_64--netbsd --with-sysroot=3D/var/obj/mknative/amd64-x86_64/usr/s=
 rc/destdir.amd64
 Thread model: posix
 gcc version 7.5.0 (nb4 20200810)=20
 COMPILER_PATH=3D/usr/libexec/
 LIBRARY_PATH=3D/usr/lib/
 COLLECT_GCC_OPTIONS=3D'-v' '-Wall' '-O2' '-fstack-protector-all' '-fstack-p=
 rotector-strong' '-march=3Dnative' '-pipe' '-o' '../lib/libtinfow.so' '-L..=
 /lib'
 ld -plugin /usr/libexec/liblto_plugin.so -plugin-opt=3D/usr/libexec/lto-wra=
 pper -plugin-opt=3D-fresolution=3D/tmp//ccFx4JTz.res -plugin-opt=3D-pass-th=
 rough=3D-lgcc_s -plugin-opt=3D-pass-through=3D-lgcc -plugin-opt=3D-pass-thr=
 ough=3D-lc -plugin-opt=3D-pass-through=3D-lgcc_s -plugin-opt=3D-pass-throug=
 h=3D-lgcc --eh-frame-hdr -dc -dp -e _start -dynamic-linker /usr/libexec/ld.=
 elf_so -o ../lib/libtinfow.so /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtb=
 egin.o -L../lib -shared ../obj_s/access.o ../obj_s/add_tries.o ../obj_s/all=
 oc_ttype.o ../obj_s/codes.o ../obj_s/comp_captab.o ../obj_s/comp_error.o ..=
 /obj_s/comp_hash.o ../obj_s/comp_userdefs.o ../obj_s/db_iterator.o ../obj_s=
 /doalloc.o ../obj_s/entries.o ../obj_s/fallback.o ../obj_s/free_ttype.o ../=
 obj_s/getenv_num.o ../obj_s/home_terminfo.o ../obj_s/init_keytry.o ../obj_s=
 /lib_acs.o ../obj_s/lib_baudrate.o ../obj_s/lib_cur_term.o ../obj_s/lib_dat=
 a.o ../obj_s/lib_has_cap.o ../obj_s/lib_kernel.o ../obj_s/lib_keyname.o ../=
 obj_s/lib_longname.o ../obj_s/lib_napms.o ../obj_s/lib_options.o ../obj_s/l=
 ib_raw.o ../obj_s/lib_setup.o ../obj_s/lib_termcap.o ../obj_s/lib_termname.=
 o ../obj_s/lib_tgoto.o ../obj_s/lib_ti.o ../obj_s/lib_tparm.o ../obj_s/lib_=
 tputs.o ../obj_s/lib_trace.o ../obj_s/lib_ttyflags.o ../obj_s/lib_twait.o .=
 ./obj_s/name_match.o ../obj_s/names.o ../obj_s/obsolete.o ../obj_s/read_ent=
 ry.o ../obj_s/read_termcap.o ../obj_s/strings.o ../obj_s/tries.o ../obj_s/t=
 rim_sgr0.o ../obj_s/unctrl.o ../obj_s/visbuf.o ../obj_s/alloc_entry.o ../ob=
 j_s/captoinfo.o ../obj_s/comp_expand.o ../obj_s/comp_parse.o ../obj_s/comp_=
 scan.o ../obj_s/parse_entry.o ../obj_s/write_entry.o ../obj_s/define_key.o =
 ../obj_s/hashed_db.o ../obj_s/key_defined.o ../obj_s/keybound.o ../obj_s/ke=
 yok.o ../obj_s/version.o --as-needed -lgcc_s --no-as-needed -lgcc -lc --as-=
 needed -lgcc_s --no-as-needed -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
 ld: /usr/lib/crt0.o: in function `__start':
 (.text+0x29): undefined reference to `__fini_array_start'
 ld: /usr/lib/crt0.o: relocation R_X86_64_PC32 against undefined hidden symb=
 ol `__fini_array_start' can not be used when making a shared object
 ld: final link failed: bad value
 ---OUTPUT ENDS---
 
 Looks like ``-Wl,-shared'' is not the same as ``-shared''. I thought it was=
 .
 
 
 RVP
 



Home | Main Index | Thread Index | Old Index