bug-hurd
[Top][All Lists]
Advanced

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

[PATCH] build: Fix shared build with gcc-7.


From: Jan Nieuwenhuizen
Subject: [PATCH] build: Fix shared build with gcc-7.
Date: Sat, 14 Mar 2020 11:35:18 +0100

Hi!

The attached patch fixes this error

--8<---------------cut here---------------start------------->8---
i586-pc-gnu-gcc -L. -L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libbpf/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libcons/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libdiskfs/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libfshelp/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libftpconn/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libhurdbugaddr/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libhurd-slab/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libihash/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libiohelp/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libnetfs/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libpager/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libpipe/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libports/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libps/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libshouldbeinlibc/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libstore/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libthreads/ 
-L/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libtrivfs/ -std=gnu99 
-fgnu89-inline -Wall -g -O3 -fno-strict-aliasing  -g -O2  
-Wl,-rpath=/gnu/store/fx77mhyfi9mx0ihg1wi76gxpfqsyi0vn-hurd-0.9-1.91a5167/lib  
-uargp_program_bug_address -o test-fcntl \
              test-fcntl.o \
      '-Wl,-(' ../libhurdbugaddr/libhurdbugaddr.so ../libfshelp/libfshelp.so \
                -lpthread \
      '-Wl,-)'
i586-pc-gnu-ld: warning: libshouldbeinlibc.so.0.3, needed by 
../libfshelp/libfshelp.so, not found (try using -rpath or -rpath-link)
i586-pc-gnu-ld: warning: libiohelp.so.0.3, needed by ../libfshelp/libfshelp.so, 
not found (try using -rpath or -rpath-link)
i586-pc-gnu-ld: warning: libports.so.0.3, needed by ../libfshelp/libfshelp.so, 
not found (try using -rpath or -rpath-link)
i586-pc-gnu-ld: warning: libihash.so.0.3, needed by ../libfshelp/libfshelp.so, 
not found (try using -rpath or -rpath-link)
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`ports_get_right'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`__assert_fail_backtrace'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`ports_port_ref'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`hurd_ihash_locp_find'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`ports_destroy_right'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to `exec_reauth'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to `idvec_free'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`hurd_ihash_remove'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`ports_port_deref_weak'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`hurd_ihash_find'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`hurd_ihash_hash32'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`ports_create_class'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`ports_create_port'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to `idvec_setid'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`hurd_ihash_locp_remove'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`hurd_ihash_locp_add'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`ports_port_deref'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`ports_port_ref_weak'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`idvec_merge_auth'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to `make_idvec'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`idvec_tail_contains'
i586-pc-gnu-ld: ../libfshelp/libfshelp.so: undefined reference to 
`hurd_ihash_add'
collect2: error: ld returned 1 exit status
make[1]: *** [../Makeconf:343: test-fcntl] Error 1
make[1]: >Leaving directory 
'/tmp/guix-build-hurd-0.9-1.91a5167.drv-0/source/libfshelp-tests'
make: *** [Makefile:254: libfshelp-tests] Error 2
--8<---------------cut here---------------end--------------->8---

that I get when cross building the Hurd on Guix, using gcc-7.5.0.

Greetings,
janneke

>From 9170bd2296e8e308c8830cc0cd14ae1676d5c6ed Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sat, 14 Mar 2020 11:28:31 +0100
Subject: [PATCH] build: Fix shared build with gcc-7.

* Makeconf (lpath): Add -Wl,-rpath <dir> next to -L <dir>.
---
 Makeconf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makeconf b/Makeconf
index 67f7ab1c..829f60c7 100644
--- a/Makeconf
+++ b/Makeconf
@@ -325,7 +325,8 @@ _libsubst=${libsubst$(patsubst 
%,-override,${libsubst-override})}
 
 # Direct the linker where to find shared objects specified in the
 # dependencies of other shared objects it encounters.
-lpath := -L. $(patsubst %,-L%,$(dir $(wildcard ../lib*/lib*.so)))
+lib_dirs := $(dir $(wildcard ../lib*/lib*.so))
+lpath := -L. $(lib_dirs:%=-L%) $(lib_dirs:%=-Wl,-rpath=%)
 
 # Main rule to link executables
 #
-- 
2.24.0

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]