Summary: | media-video/nvidia-settings-190.42 (and binutils USE=gold) fails to link -lm and -ldl | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Franz Trischberger <franz.trischberger> |
Component: | [OLD] Unspecified | Assignee: | Christian Ruppert (idl0r) <idl0r> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | esigra |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
build log
Fixes the bug nr 290432 Stefan Oswald patch for 173 branch ebuild for Stefan Oswald patch for 173 branch |
Description
Franz Trischberger
2009-10-25 07:40:41 UTC
Please post the build.log for reference. Created attachment 208194 [details]
build log
Hm, the link command doesn't seem to include -lm or -ldl, maybe that has something to do with the missing symbols... It is much more likely that it has something to do with gold linker that OP mentioned. I already need to have few files like this:
> $ cat /etc/portage/env/media-gfx/gimp-2.6.7
> # fix for gold linker
> LDFLAGS="-lglib-2.0 -lgobject-2.0 -lm"
I looks to me like gold is in some cases dropping/ignoring some transitive dependencies from libs, where original linker respects them. But I haven't investigated it too deep yet, I'm trying to rebuild system with gold first and see if it disappears when all files are linked by same linker (atm nvidia-settings fail for me with binutils-1.20[gold] too).
Same problem, binutils-1.20 WITHOUT gold. i686-pc-linux-gnu-gcc -c -O2 -march=native -pipe -fomit-frame-pointer -Wall -O -DNDEBUG -I/usr/X11R6/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I doc -I src -I src/image_data -I src/xpm_data -I src/gtk+-2.x -I src/libXNVCtrl -I src/libXNVCtrlAttributes -I src/XF86Config-parser -I samples src/libXNVCtrlAttributes/NvCtrlAttributesGlx.c -o .objs/NvCtrlAttributesGlx.o src/libXNVCtrlAttributes/NvCtrlAttributesXv.c: In function ‘NvCtrlInitXvAttributes’: src/libXNVCtrlAttributes/NvCtrlAttributesXv.c:214: warning: pointer targets in passing argument 2 of ‘__libXv->XvQueryExtension’ differ in signedness src/libXNVCtrlAttributes/NvCtrlAttributesXv.c:214: note: expected ‘unsigned int *’ but argument is of type ‘int *’ src/libXNVCtrlAttributes/NvCtrlAttributesXv.c:214: warning: pointer targets in passing argument 3 of ‘__libXv->XvQueryExtension’ differ in signedness src/libXNVCtrlAttributes/NvCtrlAttributesXv.c:214: note: expected ‘unsigned int *’ but argument is of type ‘int *’ src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:195:2: warning: #warning Old xf86vmode.h; dynamic gamma ramp support will not be compiled. src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c: In function ‘NvCtrlInitVidModeAttributes’: src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:214: error: ‘prev_error_handler’ undeclared (first use in this function) src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:214: error: (Each undeclared identifier is reported only once src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:214: error: for each function it appears in.) src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:199: warning: label ‘blocked’ defined but not used src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:84: warning: unused variable ‘i’ src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:84: warning: unused variable ‘event’ src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:84: warning: unused variable ‘ret’ src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c: In function ‘NvCtrlSetColorAttributes’: src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:273: warning: unused variable ‘ret’ src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:272: warning: unused variable ‘ch’ src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:272: warning: unused variable ‘i’ make: *** [.objs/NvCtrlAttributesVidMode.o] Error 1 make: *** Waiting for unfinished jobs.... (In reply to comment #5) > Same problem, binutils-1.20 WITHOUT gold. That is NOT the same problem. prev_error_handler is a function-pointer declared in NvCtrlAttributesVidMode.c, it is an internal symbol. "pow" "dlopen" etc. are external symbols lying in libm and libdl. What i don't like is this: ### src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:195:2: warning: #warning Old xf86vmode.h; dynamic gamma ramp support will not be compiled. ### That is the problem, as ### #if defined(X_XF86VidModeGetGammaRampSize) <---- LOOK HERE!!! /* * XXX The XF86VidMode extension can block remote clients. * Unfortunately, there doesn't seem to be a good way to determine if * we're blocked or not. So, we temporarily plug in an error handler, * and watch for the XF86VidModeClientNotLocal error code, set a flag * indicating that we should not use the XF86VidMode extension, and * then restore the previous error handler. Yuck. * * XXX Different versions of XFree86 trigger errors on different * protocol; older versions trigger an error on * XF86VidModeGetGammaRampSize(), but newer versions appear to only * error on XF86VidModeSetGammaRamp(). */ static Bool vidModeBlocked = False; static int vidModeErrorBase = 0; static int (*prev_error_handler)(Display *, XErrorEvent *) = NULL; ### prev_error_handler only gets declared, when X_XF86VidModeGetGammaRampSize is defined. Also have a look at the comment below the "if defined". Which versions of x11-libs/libXxf86vm and x11-proto/xf86vidmodeproto do you have installed? BTW: I did a complete rebuild of my system after upgrading GCC from 4.3 to 4.4, with binutils[gold], and i get this error. I have same issues. The current version of libXx86vm is 1.1.0 and xf86vidmodeproto is 2.3 Missing symbols during _compilation_ is duplicate of bug #289744 and is caused by new libXxf86vm. I did some cleaner test case to confirm that gold is the culprit. With patch for libXxf86vm from that bug in local overlay: $ ld -v GNU ld (GNU Binutils) 2.20 $ emerge -1 =nvidia-settings-190.42 (no error) $ ld -v GNU gold (GNU Binutils 2.20) 1.9 $ emerge -1 =nvidia-settings-190.42 ... /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/../../../../x86_64-pc-linux-gnu/bin/ld: .objs/NvCtrlAttributesVidMode.o: in function NvCtrlSetColorAttributes:NvCtrlAttributesVidMode.c(.text+0x4b7): error: undefined reference to 'pow' /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/../../../../x86_64-pc-linux-gnu/bin/ld: .objs/NvCtrlAttributesXv.o: in function NvCtrlXvAttributesClose:NvCtrlAttributesXv.c(.text+0x333): error: undefined reference to 'dlclose' (... more link errors ...) $ echo 'LDFLAGS="-lm -ldl"' >> /etc/portage/env/media-video/nvidia-settings-190.42 $ emerge -1 =nvidia-settings-190.42 (no error again) x11-proto/xf86vidmodeproto-2.3 x11-libs/libXxf86vm-1.1.0 Didn't realize its a different error. I'll try rebuild world and see what happens. with x11-proto/xf86vidmodeproto-2.3 x11-libs/libXxf86vm-1.1.0 same errors Yet another bug with 2 mixed issues. The header bug was fixed, sync in a hour. But the USE=gold and linking issue remains unsolved. (In reply to comment #5) > Same problem, binutils-1.20 WITHOUT gold. > > i686-pc-linux-gnu-gcc -c -O2 -march=native -pipe -fomit-frame-pointer -Wall -O > -DNDEBUG -I/usr/X11R6/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include > -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 > -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 > -I/usr/include/freetype2 -I/usr/include/libpng12 -I doc -I src -I > src/image_data -I src/xpm_data -I src/gtk+-2.x -I src/libXNVCtrl -I > src/libXNVCtrlAttributes -I src/XF86Config-parser -I samples > src/libXNVCtrlAttributes/NvCtrlAttributesGlx.c -o .objs/NvCtrlAttributesGlx.o > src/libXNVCtrlAttributes/NvCtrlAttributesXv.c: In function > ‘NvCtrlInitXvAttributes’: > src/libXNVCtrlAttributes/NvCtrlAttributesXv.c:214: warning: pointer targets in > passing argument 2 of ‘__libXv->XvQueryExtension’ differ in signedness > src/libXNVCtrlAttributes/NvCtrlAttributesXv.c:214: note: expected ‘unsigned > int *’ but argument is of type ‘int *’ > src/libXNVCtrlAttributes/NvCtrlAttributesXv.c:214: warning: pointer targets in > passing argument 3 of ‘__libXv->XvQueryExtension’ differ in signedness > src/libXNVCtrlAttributes/NvCtrlAttributesXv.c:214: note: expected ‘unsigned > int *’ but argument is of type ‘int *’ > src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:195:2: warning: #warning Old > xf86vmode.h; dynamic gamma ramp support will not be compiled. > src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c: In function > ‘NvCtrlInitVidModeAttributes’: > src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:214: error: > ‘prev_error_handler’ undeclared (first use in this function) > src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:214: error: (Each undeclared > identifier is reported only once > src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:214: error: for each > function it appears in.) > src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:199: warning: label > ‘blocked’ defined but not used > src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:84: warning: unused variable > ‘i’ > src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:84: warning: unused variable > ‘event’ > src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:84: warning: unused variable > ‘ret’ > src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c: In function > ‘NvCtrlSetColorAttributes’: > src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:273: warning: unused > variable ‘ret’ > src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:272: warning: unused > variable ‘ch’ > src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c:272: warning: unused > variable ‘i’ > make: *** [.objs/NvCtrlAttributesVidMode.o] Error 1 > make: *** Waiting for unfinished jobs.... > Fixed by declaring static int (*prev_error_handler)(Display *, XErrorEvent *) = NULL; outside #if defined(X_XF86VidModeGetGammaRampSize) in src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c (In reply to comment #12) > Fixed by declaring > static int (*prev_error_handler)(Display *, XErrorEvent *) = NULL; > outside #if defined(X_XF86VidModeGetGammaRampSize) > in src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c > I'm trying to make a patch, but I didn't really understand how to modify the code, exactly. What do you mean for "outside"? Should that line to be substituted or what else? Thank you, Flavio Created attachment 227401 [details, diff]
Fixes the bug nr 290432
After applying this patch, I can compile nvidia-settings.
(In reply to comment #14) > Created an attachment (id=227401) [details] > Fixes the bug nr 290432 > > After applying this patch, I can compile nvidia-settings. > Same here, this patch fixed the problem. I've got them fixed by editing src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c and added after #include <X11/extensions/xf86vmode.h> the line #include <X11/extensions/xf86vmproto.h> now they compiles fine. Here are my steps to install ebuild /usr/portage/media-video/nvidia-settings/nvidia-settings-180.60.ebuild configure edit /var/tmp/portage/media-video/nvidia-settings-180.60/work/nvidia-settings-1.0/src/libXNVCtrlAttributes/NvCtrlAttributesVidMode.c like my previous post ebuild /usr/portage/media-video/nvidia-settings/nvidia-settings-180.60.ebuild compile install qmerge Created attachment 247592 [details, diff]
Stefan Oswald patch for 173 branch
Thanks Stefan, build peacefully
Created attachment 247594 [details]
ebuild for Stefan Oswald patch for 173 branch
ebuild applying patch from Stefan Oswald (173 branch)
Comment on attachment 247592 [details, diff]
Stefan Oswald patch for 173 branch
this bug report has nothing to do with these missing X symbols. file a new bug.
Comment on attachment 247594 [details]
ebuild for Stefan Oswald patch for 173 branch
this bug report has nothing to do with these missing X symbols. file a new bug.
if the main nvidia-settings prog needs libm/libdl/etc..., it must link directly against those libraries. if it links against some other lib which happens to link against libm/libdl, that is not sufficient. 19x.xx doesn't exist anymore, all others should build fine now, please re-open in case I am wrong. |