You are not logged in.

#1 2014-06-05 14:18:03

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

/usr/bin/ld: cannot find -lgomp

Trying to compile wine-multimedia-git from AUR with a few custom flags.

ld insists it cannot find -lgomp, although it's never complained about that while compiling any other packages.

libgomp is installed and available at /usr/lib/libgomp.so, /usr/lib32/libgomp.so, and /usr/lib64/libgomp.so

How can I convince ld that it is wrong?

Offline

#2 2014-06-05 16:20:33

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,896

Re: /usr/bin/ld: cannot find -lgomp

how did libgomp.so get there? From a package or did you do something manually?

Edit: ok, it's part of gcc-libs. Never mind.

Last edited by Scimmia (2014-06-05 16:21:27)

Offline

#3 2014-06-05 16:34:18

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: /usr/bin/ld: cannot find -lgomp

WINE doesn't compile without libgomp:

preloader.o: In function `map_so_lib':
preloader.c:(.text+0xc2e): undefined reference to `memset'
preloader.c:(.text+0xdb5): undefined reference to `memset'
preloader.o: In function `wld_start':
preloader.c:(.text+0x1c18): undefined reference to `memset'
collect2: error: ld returned 1 exit status

Last edited by quequotion (2014-06-06 11:52:12)

Offline

#4 2014-06-05 16:38:02

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: /usr/bin/ld: cannot find -lgomp

Scimmia wrote:

how did libgomp.so get there? From a package or did you do something manually?

Edit: ok, it's part of gcc-libs. Never mind.

Yes, so both actually. It got there either when I installed Arch itself or base-devel.

Offline

#5 2014-06-05 17:01:06

\hbar
Member
Registered: 2014-03-15
Posts: 165

Re: /usr/bin/ld: cannot find -lgomp

Does the file 'etc/ld.so.conf.d/lib32-glibc.conf' exist (it should be installed by the lib32-glibc package which is required by the gcc-multilib package) and contain /usr/lib32? You could try to run 'ldconfig' as root to update the ld bindings.

Offline

#6 2014-06-05 19:35:18

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: /usr/bin/ld: cannot find -lgomp

\hbar wrote:

Does the file 'etc/ld.so.conf.d/lib32-glibc.conf' exist (it should be installed by the lib32-glibc package which is required by the gcc-multilib package) and contain /usr/lib32?

It does and it does.

You could try to run 'ldconfig' as root to update the ld bindings.

Done, unfortunately no change.

Offline

#7 2014-06-05 22:25:27

\hbar
Member
Registered: 2014-03-15
Posts: 165

Re: /usr/bin/ld: cannot find -lgomp

Does this command find the library?

 ld -melf_i386 -L/usr/lib32 -t -lgomp

Can you post the error message you get when trying to compile the package?

Offline

#8 2014-06-06 03:53:07

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: /usr/bin/ld: cannot find -lgomp

looks like this works:

$ ld -melf_i386 -L/usr/lib32 -t -lgomp
ld: mode elf_i386
-lgomp (/usr/lib32/libgomp.so)
ld: warning: cannot find entry symbol _start; not setting start address

building wine does not work:

/usr/bin/ld: cannot find -lgomp
collect2: error: ld returned 1 exit status
Makefile:174: recipe for target 'wine64-preloader' failed
make[1]: *** [wine64-preloader] Error 1
Makefile:17605: recipe for target 'loader' failed
make: *** [loader] Error 2

I've tried a large variety of flags just in case that was the problem, but I cannot find any combination that produces different results.
Here's the least crazy I've tested so far. These flags shouldn't cause problems with anything as far as I know. Still, ld cannot find -lgomp.
/etc/makepkg.conf

CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=native -O3 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wno-error -w"
CXXFLAGS="-march=native -O3 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wno-error -w"
LDFLAGS="-Wl,-O3,--sort-common,--as-needed,-z,relro,-lgomp"
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j8 --quiet"
#-- Debugging flags
DEBUG_CFLAGS="-g -fvar-tracking-assignments"
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"

Last edited by quequotion (2014-06-06 11:50:39)

Offline

#9 2014-06-06 15:02:25

\hbar
Member
Registered: 2014-03-15
Posts: 165

Re: /usr/bin/ld: cannot find -lgomp

Why do you think you need to add -lgomp to /etc/makepkg.conf ? 'memset' is defined in string.h so why do you think that the error you mentionned earlier comes from not linking against libgomp?

Have you tried changing O3 back to O1? Maybe the code in preloader.c is not standards compliant.

Offline

#10 2014-06-07 09:55:19

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: /usr/bin/ld: cannot find -lgomp

\hbar wrote:

Why do you think you need to add -lgomp to /etc/makepkg.conf ? 'memset' is defined in string.h so why do you think that the error you mentionned earlier comes from not linking against libgomp?

Have you tried changing O3 back to O1? Maybe the code in preloader.c is not standards compliant.

First there were the memset errors, so I asked google what they mean; after comparing various results it seemed to tell me this has something to do with openmp, and that the errors go away when linking with -lgomp.

I'l try reducing the optimization a bit more, but it strikes me as rather odd that ld says it can't find "-lgomp", not even "cannot find libgomp"; as if the parameter weren't even being parsed.

Offline

#11 2014-06-07 10:09:13

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 813
Website

Re: /usr/bin/ld: cannot find -lgomp

quequotion wrote:

First there were the memset errors, so I asked google what they mean; after comparing various results it seemed to tell me this has something to do with openmp, and that the errors go away when linking with -lgomp.

And now that I consult google again, I find nothing at all like the search results I found before. In fact, where hours and hours of searching previously yielded nothing similar to my problem, I now find dozens of reports of this issue (with llvm and gcc 4.8, neither of which I am using) and a possible workaround (-fno-builtins, but wine should specify that for itself).

WTF?

::EDIT::

hrm... not working... back to square one, without -lgomp:

preloader.o: In function `map_so_lib':
preloader.c:(.text+0xf64): undefined reference to `memset'
preloader.c:(.text+0x1239): undefined reference to `memset'
preloader.o: In function `wld_start':
preloader.c:(.text+0x26df): undefined reference to `memset'
collect2: error: ld returned 1 exit status
Makefile:174: recipe for target 'wine64-preloader' failed
make[1]: *** [wine64-preloader] Error 1
Makefile:17605: recipe for target 'loader' failed
make: *** [loader] Error 2
make: *** Waiting for unfinished jobs....
../../../wine-multimedia/tools/wrc/parser.y: warning: 5 shift/reduce conflicts [-Wconflicts-sr]
../../../wine-multimedia/tools/wrc/parser.y: warning: 5 shift/reduce conflicts [-Wconflicts-sr]
change.o: In function `req_read_directory_changes._loopfn.0':
change.c:(.text+0x2c1a): undefined reference to `omp_get_num_threads'
change.c:(.text+0x2c21): undefined reference to `omp_get_thread_num'
change.o: In function `req_read_directory_changes._loopfn.1':
change.c:(.text+0x2e2a): undefined reference to `omp_get_num_threads'
change.c:(.text+0x2e31): undefined reference to `omp_get_thread_num'
console.o: In function `req_read_console_output':
console.c:(.text+0x43e0): undefined reference to `GOMP_parallel'
console.c:(.text+0x4483): undefined reference to `GOMP_parallel'
console.c:(.text+0x4520): undefined reference to `GOMP_parallel'
console.o: In function `req_fill_console_output':
console.c:(.text+0x57b8): undefined reference to `GOMP_parallel'
console.c:(.text+0x588e): undefined reference to `GOMP_parallel'
console.o:console.c:(.text+0x590a): more undefined references to `GOMP_parallel' follow
console.o: In function `req_read_console_output._loopfn.0':
console.c:(.text+0x69ec): undefined reference to `omp_get_num_threads'
console.c:(.text+0x69f8): undefined reference to `omp_get_thread_num'
console.o: In function `req_read_console_output._loopfn.1':
console.c:(.text+0x6ebc): undefined reference to `omp_get_num_threads'
console.c:(.text+0x6ec8): undefined reference to `omp_get_thread_num'
console.o: In function `req_read_console_output._loopfn.2':
console.c:(.text+0x73be): undefined reference to `omp_get_num_threads'
console.c:(.text+0x73ca): undefined reference to `omp_get_thread_num'
console.o: In function `req_fill_console_output._loopfn.3':
console.c:(.text+0x753e): undefined reference to `omp_get_num_threads'
console.c:(.text+0x754a): undefined reference to `omp_get_thread_num'
console.o: In function `req_fill_console_output._loopfn.4':
console.c:(.text+0x767e): undefined reference to `omp_get_num_threads'
console.c:(.text+0x768b): undefined reference to `omp_get_thread_num'
console.o: In function `req_fill_console_output._loopfn.5':
console.c:(.text+0x77be): undefined reference to `omp_get_num_threads'
console.c:(.text+0x77cb): undefined reference to `omp_get_thread_num'
console.o: In function `req_fill_console_output._loopfn.6':
console.c:(.text+0x78fe): undefined reference to `omp_get_num_threads'
console.c:(.text+0x790b): undefined reference to `omp_get_thread_num'
console.o: In function `req_fill_console_output._loopfn.7':
console.c:(.text+0x7a3c): undefined reference to `omp_get_num_threads'
console.c:(.text+0x7a49): undefined reference to `omp_get_thread_num'
hook.o: In function `req_set_hook._loopfn.0':
hook.c:(.text+0x1dd2): undefined reference to `omp_get_num_threads'
hook.c:(.text+0x1dd9): undefined reference to `omp_get_thread_num'
thread.o: In function `create_thread._loopfn.0':
thread.c:(.text+0x569a): undefined reference to `omp_get_num_threads'
thread.c:(.text+0x56a1): undefined reference to `omp_get_thread_num'
collect2: error: ld returned 1 exit status
Makefile:203: recipe for target 'wineserver' failed
make[1]: *** [wineserver] Error 1
make[1]: *** Waiting for unfinished jobs....
change.o: In function `req_read_directory_changes._loopfn.0':
change.c:(.text+0x2c1a): undefined reference to `omp_get_num_threads'
change.c:(.text+0x2c21): undefined reference to `omp_get_thread_num'
change.o: In function `req_read_directory_changes._loopfn.1':
change.c:(.text+0x2e2a): undefined reference to `omp_get_num_threads'
change.c:(.text+0x2e31): undefined reference to `omp_get_thread_num'
console.o: In function `req_read_console_output':
console.c:(.text+0x43e0): undefined reference to `GOMP_parallel'
console.c:(.text+0x4483): undefined reference to `GOMP_parallel'
console.c:(.text+0x4520): undefined reference to `GOMP_parallel'
console.o: In function `req_fill_console_output':
console.c:(.text+0x57b8): undefined reference to `GOMP_parallel'
console.c:(.text+0x588e): undefined reference to `GOMP_parallel'
console.o:console.c:(.text+0x590a): more undefined references to `GOMP_parallel' follow
console.o: In function `req_read_console_output._loopfn.0':
console.c:(.text+0x69ec): undefined reference to `omp_get_num_threads'
console.c:(.text+0x69f8): undefined reference to `omp_get_thread_num'
console.o: In function `req_read_console_output._loopfn.1':
console.c:(.text+0x6ebc): undefined reference to `omp_get_num_threads'
console.c:(.text+0x6ec8): undefined reference to `omp_get_thread_num'
console.o: In function `req_read_console_output._loopfn.2':
console.c:(.text+0x73be): undefined reference to `omp_get_num_threads'
console.c:(.text+0x73ca): undefined reference to `omp_get_thread_num'
console.o: In function `req_fill_console_output._loopfn.3':
console.c:(.text+0x753e): undefined reference to `omp_get_num_threads'
console.c:(.text+0x754a): undefined reference to `omp_get_thread_num'
console.o: In function `req_fill_console_output._loopfn.4':
console.c:(.text+0x767e): undefined reference to `omp_get_num_threads'
console.c:(.text+0x768b): undefined reference to `omp_get_thread_num'
console.o: In function `req_fill_console_output._loopfn.5':
console.c:(.text+0x77be): undefined reference to `omp_get_num_threads'
console.c:(.text+0x77cb): undefined reference to `omp_get_thread_num'
console.o: In function `req_fill_console_output._loopfn.6':
console.c:(.text+0x78fe): undefined reference to `omp_get_num_threads'
console.c:(.text+0x790b): undefined reference to `omp_get_thread_num'
console.o: In function `req_fill_console_output._loopfn.7':
console.c:(.text+0x7a3c): undefined reference to `omp_get_num_threads'
console.c:(.text+0x7a49): undefined reference to `omp_get_thread_num'
hook.o: In function `req_set_hook._loopfn.0':
hook.c:(.text+0x1dd2): undefined reference to `omp_get_num_threads'
hook.c:(.text+0x1dd9): undefined reference to `omp_get_thread_num'
thread.o: In function `create_thread._loopfn.0':
thread.c:(.text+0x569a): undefined reference to `omp_get_num_threads'
thread.c:(.text+0x56a1): undefined reference to `omp_get_thread_num'
collect2: error: ld returned 1 exit status

::UPDATE::
Wine does compile now, but I never found a solution to this problem. My theories at the moment are either that an undeclared lib32- dependency is now satisfied (a side benefit of mmug-qq), wine itself was updated to fix the problem (haven't checked the rather extensive git commit log), or some configuration file somewhere has been updated into a working state...

Last edited by quequotion (2014-09-07 14:02:32)

Offline

Board footer

Powered by FluxBB