|
From: | Ivan Vučica |
Subject: | Re: issues with -R linker paths and Clang |
Date: | Sat, 5 Aug 2017 17:54:07 +0100 |
Hi,
on a NetBSD system where I extra use clang instead of standard gcc, I have issues building back.
In specific, I noticed when building the xlib backend, but the issue is generic, but I did not notice with cairo because it does not link directly to certain X libraries, so it went unnoticed.
To run sucessfully, I need this
-Wl,-R/usr/X11R7/lib
so that e.g. Xcursor and other libraries gets found on runtime.
However our configure file generates in config.make this:
GRAPHIC_LIBS=-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lXft -lfontconfig -L/usr/X11R7/lib -lXcursor -lXfixes -lXmu -lXt -lXext -lX11 -lGL
GRAPHIC_CFLAGS=-D_REENTRANT -I/usr/pkg/include -I/usr/X11R7/include/freetype2 -I/usr/X11R7/include -I/usr/pkg/include/freetype2 -I/usr/X11R7/include -I/usr/X11R7/include
GRAPHIC_LFLAGS=
X_PRE_LIBS= -lSM -lICE
everything compiles and links, but on run I get unresolved shared objects which are in /usr/X11R7/lib
This is all done in configure, but where?
One explanation I found is that it is done automatically and that the configure check is bad.
I found this in config.log:
configure:3659: checking for X
configure:3848: result: libraries /usr/X11R7/lib, headers /usr/X11R7/include
configure:3868: checking whether -R must be followed by a space
configure:3884: clang -o conftest -g -O2 -I/System/Library/Headers -I/usr/pkg/include -L/System/Library/Libraries/gnu-gnu-gn
u -L/System/Library/Libraries -Wl,-R/usr/pkg/lib -L/usr/pkg/lib conftest.c -R/usr/X11R7/lib >&5
clang: warning: argument unused during compilation: '-R/usr/X11R7/lib'
configure:3884: $? = 0
then this is used:
configure:3901: clang -o conftest -g -O2 -I/System/Library/Headers -I/usr/pkg/include -L/System/Library/Libraries/gnu-gnu-gn
u -L/System/Library/Libraries -Wl,-R/usr/pkg/lib -L/usr/pkg/lib conftest.c -R /usr/X11R7/lib >&5
clang: warning: argument unused during compilation: '-R'
/usr/X11R7/lib: file not recognized: File format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)
the warning is interpreted as failure, the error too and so neither option is added.
This is actually a linker directive passed to through the compiler, right?
The check itself is apparently useless for us, since only certain compilers require a space after -R (cited is Sun) and since we require Objective-C, to my knowledge we can use only clang or gcc as of now (and the past 15 years?)
Riccardo
_______________________________________________
Gnustep-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/gnustep-dev
[Prev in Thread] | Current Thread | [Next in Thread] |