crda: fix build failure for nios2
PATCH 1/1 crda: fix build failure for nios2
libgcrypt depends on libgpg-error and this isn't accounted for in crda makefile, but it is in libgcrypt-config script (in the correct order for linking), so set LDLIBS calling this script not only for static linking.
Fixes http://autobuild.buildroot.org/results/156/15656ef0187b0a8db6c66fc7a7fcb58a99999fa1
--- package/crda/crda.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
package/crda/crda.mk +3 -3
@@ -16,12 +16,12 @@ CRDA_LICENSE_FILES = LICENSE # And library order matters hence stick -lnl-3 first since it's appended # in the crda Makefiles as in NLLIBS+=-lnl-3 ... thus failing. # -# libgcrypt needs -lgpg-error if linking statically, which is correctly -# set by the libgcrypt-config script (and in the right order). ifeq ($(BR2_PREFER_STATIC_LIB),y) CRDA_NLLIBS += -lnl-3 -lm -lpthread -CRDA_LDLIBS += `$(STAGING_DIR)/usr/bin/libgcrypt-config --libs` endif +# libgcrypt needs -lgpg-error, which is correctly +# set by the libgcrypt-config script (and in the right order). +CRDA_LDLIBS += `$(STAGING_DIR)/usr/bin/libgcrypt-config --libs` define CRDA_BUILD_CMDS $(TARGET_CONFIGURE_OPTS) \
Signature · 1 line
1.7.10.4
PATCH 1/1 crda: fix build failure for nios2
Quoted 9 lines · Frank Bergmann
libgcrypt depends on libgpg-error and this isn't accounted for in crda makefile, but it is in libgcrypt-config script (in the correct order for linking), so set LDLIBS calling this script not only for static linking.
Fixes
http://autobuild.buildroot.org/results/156/15656ef0187b0a8db6c66fc7a7fcb58a99999fa1Signed-off-by Frank Bergmann <[email protected]>
Regards,
Signature · 1 line
Samuel
PATCH 1/1 crda: fix build failure for nios2
In reply to Frank BergmannDear Frank Bergmann,
Quoted 11 lines · Frank Bergmann
libgcrypt depends on libgpg-error and this isn't accounted for in crda makefile, but it is in libgcrypt-config script (in the correct order for linking), so set LDLIBS calling this script not only for static linking.
Fixes http://autobuild.buildroot.org/results/156/15656ef0187b0a8db6c66fc7a7fcb58a99999fa1
Signed-off-by Frank Bergmann <[email protected]>--- package/crda/crda.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Note that the patch didn't apply for me on the latest master. It might be caused by whitespace damage. Frank, please use "git send-email" to send your patches the next time, because your e-mail client is doing funky things with patches that render them unapplicable.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 crda: fix build failure for nios2
In reply to Frank BergmannQuoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Frank" == Frank Bergmann <[email protected]> writes:
libgcrypt depends on libgpg-error and this isn't accounted for in crda makefile, but it is in libgcrypt-config script (in the correct order for linking), so set LDLIBS calling this script not only for static linking.
Fixes http://autobuild.buildroot.org/results/156/15656ef0187b0a8db6c66fc7a7fcb58a99999fa1
I know both Samuel and Thomas added their acks, but I still don't get how this can be a nios2 only thing.
On ARM, I don't see libgpg-error exporting such a symbol:
./output/host/usr/bin/arm-linux-nm -D output/target/usr/lib/libgpg-error.so
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
w _Jv_RegisterClasses0000abf8 A __bss_end__0000abdc A __bss_start0000abdc A __bss_start__
w __cxa_finalize
w __deregister_frame_info0000abf8 A __end__
U __errno_location
U __glibc_strerror_r
w __register_frame_info0000abf8 A _bss_end__0000abdc A _edata0000abf8 A _end00000d20 T _fini000005fc T _init00000c14 T gpg_err_code_from_errno00000c90 T gpg_err_code_from_syserror00000bdc T gpg_err_code_to_errno
00000844 T gpg_err_deinit0000068c T gpg_err_init
00000848 T gpg_err_set_errno000008f8 T gpg_error_check_version00000a6c T gpg_strerror00000ac4 T gpg_strerror_r000009b8 T gpg_strsource
U memcpy
U strerror
U strlen
I don't see crda explicitly accessing a _gp symbol:
grep -rls gp output/build/crda-1.1.3
And libgcrypt lists gpg-error as NEEDED, so the runtime linker should pull it in automatically without us having to explicitly link with it:
./output/host/usr/bin/arm-linux-readelf -a output/target/usr/lib/libgcrypt.so|grep NEEDED
0x00000001 (NEEDED) Shared library: [libgpg-error.so.0]
0x00000001 (NEEDED) Shared library: [libc.so.0]
Are we sure we're not really just pampering over some kind of nios2 binutils / ld issue?
Quoted 31 lines
Signed-off-by Frank Bergmann <[email protected]>--- package/crda/crda.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)package/crda/crda.mk +3
-3@@ -16,12 +16,12 @@ CRDA_LICENSE_FILES = LICENSE # And library order matters hence stick -lnl-3 first since it's appended # in the crda Makefiles as in NLLIBS+=-lnl-3 ... thus failing. # -# libgcrypt needs -lgpg-error if linking statically, which is correctly -# set by the libgcrypt-config script (and in the right order). ifeq ($(BR2_PREFER_STATIC_LIB),y) CRDA_NLLIBS += -lnl-3 -lm -lpthread -CRDA_LDLIBS += `$(STAGING_DIR)/usr/bin/libgcrypt-config --libs` endif +# libgcrypt needs -lgpg-error, which is correctly +# set by the libgcrypt-config script (and in the right order). +CRDA_LDLIBS += `$(STAGING_DIR)/usr/bin/libgcrypt-config --libs` define CRDA_BUILD_CMDS $(TARGET_CONFIGURE_OPTS) \Signature · 5 lines
1.7.10.4 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 crda: fix build failure for nios2
Quoted 7 lines · Peter Korsgaard
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Frank" == Frank Bergmann <[email protected]> writes:
libgcrypt depends on libgpg-error and this isn't accounted for in crda makefile, but it is in libgcrypt-config script (in the correct order for linking), so set LDLIBS calling this script not only for static linking.
Quoted 6 lines
Quoted 1 line
Fixes http://autobuild.buildroot.org/results/156/15656ef0187b0a8db6c66fc7a7fcb58a99999fa1
I know both Samuel and Thomas added their acks, but I still don't get how this can be a nios2 only thing.
On ARM, I don't see libgpg-error exporting such a symbol:
But on nios2:
./output/host/usr/bin/nios2-linux-gnu-nm -D output/target/usr/lib/libgpg-error.so
U bindtextdomain
00004278 S __bss_start
w __cxa_finalize
U dcgettext
00004278 G _edata
00004280 S _end
U __errno_location000012a0 T _fini0000c190 A _gp000010ac T gpg_err_code_from_errno
00001154 T gpg_err_code_from_syserror
00001050 T gpg_err_code_to_errno00000b40 T gpg_err_deinit000008f4 T gpg_err_init00000c88 T gpg_error_check_version00000b44 T gpg_err_set_errno00000e3c T gpg_strerror00000ed0 T gpg_strerror_r00000d54 T gpg_strsource000007e8 T _init
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
w _Jv_RegisterClasses
U memcpy
U strerror
U strerror_r
U strlen
Quoted 7 lines
I don't see crda explicitly accessing a
_gpsymbol:grep -rls gp output/build/crda-1.1.3
And libgcrypt lists gpg-error as NEEDED, so the runtime linker should pull it in automatically without us having to explicitly link with it:
Quoted 6 lines
./output/host/usr/bin/arm-linux-readelf -a output/target/usr/lib/libgcrypt.so|grep NEEDED
0x00000001(NEEDED) Shared library: [libgpg-error.so.0]
0x00000001(NEEDED) Shared library: [libc.so.0]Are we sure we're not really just pampering over some kind of nios2 binutils / ld issue?
Not really. The binary starts but I have no wireless device and infrastructure to fully test it on a target.
So drop the patch and disable crda for nios2 ?
Frank.