discuss-gnustep
[Top][All Lists]
Advanced

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

problem with inline functions in gsweb and clang


From: Sebastian Reitenbach
Subject: problem with inline functions in gsweb and clang
Date: Mon, 27 May 2013 13:56:58 +0200
User-agent: SOGoMail 2.0.5a

Hi,

in gsweb, when trying to compile the examples of GSWeb with clang 3.2, I get 
the following error:

$ CC="clang -v" gmake     
This is gnustep-make 2.6.4. Type 'gmake print-gnustep-make-help' for help.
Running in gnustep-make version 2 strict mode.
Making all for gswapp WebBookStore1...
 Linking gswapp WebBookStore1 ...
clang version 3.2 (tags/RELEASE_32/final)
Target: amd64-unknown-openbsd5.3
Thread model: posix
 "/usr/bin/ld" -nopie -e __start --eh-frame-hdr -Bdynamic -dynamic-linker 
/usr/libexec/ld.so -o WebBookStore1.gswa/./WebBookStore1 /usr/lib/crt0.o 
/usr/lib/crtbegin.o -L/usr/lib/gcc-lib/amd64-unknown-openbsd5.3/4.2.1 
-L/usr/local/lib -L/home/sebastia/GNUstep/Library/Libraries -L/usr/local/lib 
-L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -E 
./obj/WebBookStore1.obj/Application.m.o ./obj/WebBookStore1.obj/Session.m.o 
./obj/WebBookStore1.obj/DirectAction.m.o ./obj/WebBookStore1.obj/Main.m.o 
./obj/WebBookStore1.obj/WebBookStore1_main.m.o -lWebObjects -lWOExtensions 
-lGSWDatabase -lEOAccess -lEOControl -lpng -lz -lxml2 -lz -liconv -lm 
-lgnustep-base -lobjc2 -lm -lgcc -lpthread -lc -lgcc /usr/lib/crtend.o
/usr/local/lib/libWebObjects.so.0.0: warning: vsprintf() is often misused, 
please use vsnprintf()
/usr/local/lib/libWebObjects.so.0.0: warning: strcpy() is almost always 
misused, please use strlcpy()
/usr/local/lib/libWebObjects.so.0.0: warning: strcat() is almost always 
misused, please use strlcat()
/usr/local/lib/libWebObjects.so.0.0: warning: sprintf() is often misused, 
please use snprintf()
/usr/local/lib/libgcrypt.so.18.0: warning: stpcpy() is dangerous GNU crap; 
don't use it
/usr/local/lib/libWebObjects.so.0.0: undefined reference to `parseNumber'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to `parseArray'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to 
`skipBlanksAndComments'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to `parsePragma'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to `areUnicharEquals'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to `parseDeclaration'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to `skipComment'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to `skipBlanks'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to `parseIdentifier'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to `parseHexNumber'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to `parseQuotedString'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to 
`parseDictionaryWithValuesAsAssociations'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to `tryParseBoolean'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to `parseKeyPath'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to 
`parseValueAsAssociation'
/usr/local/lib/libWebObjects.so.0.0: undefined reference to `parseHexData'
clang-3: error: linker command failed with exit code 1 (use -v to see 
invocation)
gmake[2]: *** [WebBookStore1.gswa/./WebBookStore1] Error 1
gmake[1]: *** [WebBookStore1.all.gswapp.variables] Error 2
gmake: *** [internal-all] Error 2

most of the undefined sybols come from the GSWDeclarationParser.m, which is 
compiled this way:
clang GSWDeclarationParser.m -c \
      -MMD -MP -I/usr/local/include/gnustep -DGSWEB_WONAMES -DGNUSTEP 
-DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_R
UNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -fexceptions 
-fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS -fobjc-non
fragile-abi -D_NONFRAGILE_ABI -pthread -fPIC -DDEBUG -fno-omit-frame-pointer 
-Wall -DGSWARN -DGSDIAGNOSE -Wno-import -O2 -
pipe -g -O0 -fgnu-runtime -Werror-implicit-function-declaration -Werror 
-fconstant-string-class=NSConstantString -I./. -I/
usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include/libxml2 
-I/usr/local/include -I/usr/local/include/libp
ng -I./derived_src -I. -I/usr/local/include 
-I/gnustep-web-1.3.0_writes_to_HOME/GNUstep/Library/Headers -I/usr/local/inclu
de \
       -o obj/WebObjects/WebObjects.obj/GSWDeclarationParser.m.o

and then linked into libWebObjects this way:
cc -shared  -Wl,-E     -L/usr/local/lib  -pthread -fexceptions 
-fobjc-nonfragile-abi -o ./WebObjects.framework/Versions/0.
0/./libWebObjects.so.0.0 obj/WebObjects/WebObjects.obj/NSFramework_WebObjects.o 
obj/WebObjects/WebObjects.obj/GSWDebug.m.o
 obj/WebObjects/WebObjects.obj/GSWConstants.m.o 
obj/WebObjects/WebObjects.obj/GSWTemporaryElement.m.o obj/WebObjects/WebOb
jects.obj/GSWBaseParser.m.o obj/WebObjects/WebObjects.obj/GSWHTMLRawParser.m.o 
obj/WebObjects/WebObjects.obj/GSWHTTPIO.m.o
 obj/WebObjects/WebObjects.obj/GSWDeclaration.m.o 
obj/WebObjects/WebObjects.obj/GSWDeclarationParser.m.o
....

The functions are declared like this:

inline NSDictionary* 
parseDictionaryWithValuesAsAssociations(GSWDeclarationParser* parser,
                                                              BOOL 
valuesAsAssociations)
 {
   return 
((*parser->_selfIMPs._parseDictionaryWithValuesAsAssociationsIMP)(parser,parseDictionaryWithValuesAsAssociationsSEL,valuesAsAssociations));
 };

When I remove the inline before that, then libWebObjects can resolve the 
symbols. Since its compiled with -O0, I think the compiler should not inline 
those functions?

I tried that on OpenBSD, David Wetzel seemed to use gcc on NetBSD, where the 
problem did not occured to him.
Is it sane to just remove the inline statement, or is there something more 
clever I can do about it?

cheers,
Sebastian






reply via email to

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