discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Link error building a .m tool with clang on Linux


From: Ivan Vučica
Subject: Re: Link error building a .m tool with clang on Linux
Date: Thu, 04 Jan 2018 19:08:34 +0000

This should indeed be present in the runtime, I think. I was wondering if it should be -lobjc2, but I am writing on the phone, and I vaguely recall the libobjc2 runtime is indeed called libobjc.so.*.

Some traditional silly questions from me :-)

Can you reproduce this with a GNUmakefile which uses gnustep-slideshow to build a target of type TOOL? You might be already using it, so I'm just confirming that you are.

How did you rebuild libAkamaiKit? Does it use the same runtime, same compiler and the same build options as the lib2tree?

Finally, with -fobjc-runtime set correctly, you should be able to omit -fobjc-nonfragile-abi. I don't think it changes anything in this case, just useful to know.

Are you using the latest gnustep-make too?

On Thu 4 Jan 2018 at 17:13 Lobron, David <dlobron@akamai.com> wrote:
Hello gnustep,

I recently picked up the latest libobjc2 and gnustep-base libraries, while working on a clang build of some ObjC and ObjC++ programs on Ubuntu Linux.  The latest codebases solved a number of other problems I was having, but a symbol is now missing in a shared library that some sub-programs use, causing those programs not to link.  Here is a representative example:

/home/dlobron/build/clangport/akamai/llvm/llvm-5.0.0.install/bin/clang  -rdynamic     -m64  -rdynamic  -pthread  -fexceptions -fobjc-runtime=gnustep-1.8 -fblocks -o obj/list2tree \
                ./obj/list2tree.obj/list2tree.m.o \
                  -L/home/dlobron/build/clangport/akamai/AkamaiKit/Tools/../../common/lib -L../AkamaiKit.framework/Versions/Current/.    -L/home/dlobron/GNUstep/Library/Libraries -L/home/dlobron/build/clangport/akamai/common/GNUstep/Local/Library/Libraries -L/home/dlobron/build/clangport/akamai/common/GNUstep/System/Library/Libraries   -lAkamaiKit -lXMLKit -lopenssl   -lgnustep-base   -lpthread -lobjc -fobjc-nonfragile-abi   -lm
../AkamaiKit.framework/Versions/Current/./libAkamaiKit.so: undefined reference to `vtable for gnustep::libobjc::__objc_class_type_info'
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)

Here, libAkamaiKit.so is a shared library.  Upon examination, the symbol in question is indeed present and not defined:

U vtable for gnustep::libobjc::__objc_class_type_info

I examined some builds that used my previous versions of gnustep-base and libobjc2.  In those builds, the above symbol does not appear at all in the shared library, libAkamaiKit.so.

Does anyone know of recent changes in gnustep-base or libobjc2 that might cause this?  Should I add a library in my link command?  I'm already linking libobjc.so, and I confirmed that no __objc_class_type_info symbol is present there.  I'm also working on a minimal reproducer.

Thank you,

David
_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
--
Sent from Gmail Mobile on iPad

reply via email to

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