gnustep-dev
[Top][All Lists]
Advanced

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

Re: FreeBSD 9.1 missing libcxxrt - is it needed for objc2?


From: Maxthon Chan
Subject: Re: FreeBSD 9.1 missing libcxxrt - is it needed for objc2?
Date: Thu, 13 Jun 2013 04:43:30 +0800

Actually, buddy, you screwed the library up. Do not turn off Tests!

Sent from my iPhone

On 2013年6月13日, at 4:37, Frank Rehwinkel <address@hidden> wrote:

Well I realized the new failure in trying to build libobjc was coming from the Test directory and I had disabled the Test option the first time I used cmake.  So that explains why this problem didn't surface the first time.

But I'm left with the first problem reported.  That -base won't link with the libobjc.so.4.6. Even when -lsup++ is added to the link options.


On Wed, Jun 12, 2013 at 2:31 PM, Maxthon Chan <address@hidden> wrote:
Hmm? Maybe the -std=gnu99 is an issue?

I never built it using ninja so I am not so sure. Try use make?

在 2013-6-13,上午2:29,Frank Rehwinkel <address@hidden> 写道:

Checking the ccmake settings for libobjc2, it is already setup to use libsupc++.

Here is the ninja build failure.

/usr/local/bin/clang  
    -std=gnu99  -fexceptions   
    Test/CMakeFiles/AllocatePair_optimised.dir/AllocatePair.m.o  
    -o Test/AllocatePair_optimised  
    libobjc.so.4.6 -lsupc++ -Wl,-rpath,/home/frank/objc/build-1.7-RC1 
    libobjc.so.4.6: undefined reference to `vtable for std::type_info'                              
    libobjc.so.4.6: undefined reference to `std::type_info::__is_function_p() const'                
    libobjc.so.4.6: undefined reference to `typeinfo for std::type_info'                            
    libobjc.so.4.6: undefined reference to `std::type_info::~type_info()'                           
    libobjc.so.4.6: undefined reference to `std::type_info::__do_upcast(__cxxabiv1::__class_type_inf
    o const*, void**) const'                                                                        
    libobjc.so.4.6: undefined reference to `std::type_info::__is_pointer_p() const'                 
clang-3.4: error: linker command failed with exit code 1 (use -v to see invocation)             
ninja: build stopped: subcommand failed.  


On Wed, Jun 12, 2013 at 2:19 PM, Maxthon Chan <address@hidden> wrote:
Oh I missed this out, you can build LLVM libc++ linking against libsupc++ too.

My building system on Ubuntu is like this:

clang -> LLVM -> libc++ -> libsupc++ (I am using 3.3rc2, not 3.4 head)
Étoilé -> gnustep-gui -> gnustep-base -> libobjc2 -> libsupc++
libobjc2 -> libdispatch -> libobjc2 (ln -s libobjc.so libBlocksRuntime.so)
Étoilé -> libc++

在 2013-6-13,上午2:14,Frank Rehwinkel <address@hidden> 写道:

In trying to understand your suggestion by searching the web for llvm and libcxxrt references, I run into notes saying that clang is normally linked with libsupc++.  libsupc++ is in both the FreeBSD 9.1 host and the jail.

Is using libsupc++ an option for building libobjc2 and gnustep-base?  


On Wed, Jun 12, 2013 at 1:57 PM, Maxthon Chan <address@hidden> wrote:
Download and build it separately using the same SVN head version.

If you built that, you should also build libc++ (LLVM's C++ runtime) and (maybe) link it against libc++rt.

Also, when building gnustep-base, specify -I/usr/local/include and -L/usr/local/lib appropriately.

在 2013-6-13,上午1:54,Frank Rehwinkel <address@hidden> 写道:

gnustep-base configuration fails.  See link error at the bottom and the command line from config.log.  In trying to rebuild objc2 1.7-RC1, I get similar link errors now.  I don't know why I didn't get these before but maybe because now gnustep-make has been installed.

Anyway, these errors seem to indicate that the libcxxrt.a is needed but missing.  In my FreeBSD 9.1 jail, there isn't even source for this library let alone the library, and no port.  On the FreeBSD host, there are the source directories for it but as pointed out earlier, this library is not yet built automatically.  

On a fresh FreeBSD 9.1 jail, where llvm and clang (trunk head 3.4) have been manually built and installed to /usr/local, the configure step for -base fails to link objc code.

If I do need the libcxxrt.a, how do I build on the host?  If I can do that, manually copying library and headers to jail is then necessary I guess.

I tried to follow instructions from
http://lists.gnu.org/archive/html/gnustep-dev/2013-03/msg00127.html (Building libobjc2 on FreeBSD 9.1 with clang 3.2 using cmake fails)

which says to add MK_LIBCPLUSPLUS = yes
to /etc/make.conf but then make in /usr/src/lib/libcxxrt gives this error

"/usr/share/mk/bsd.own.mk", line 478: MK_LIBCPLUSPLUS can't be set by a user.

FreeBSD 9.1 seems to ship with clang 3.1 but the ports would bring it to 3.2.  If I'm building the library manually, which clang version is sufficient?

In case libcxxrt isn't needed, here are the configure calls for -make and -base.  gnustep-make is built and installed with gmake and gmake install (run as root).

export CC=/usr/local/bin/clang 
export CXX=${CC}
(
cd core/make
./configure \
    --with-layout=gnustep \
    --with-objc-lib-flag=-l:libobjc.so.4.6 \
    CC=${CC} CXX=${CXX} 
gmake
gmake install # as root
)
export GNUSTEP_CONFIG_FILE=/etc/GNUstep.conf
.  /usr/GNUstep/System/Library/Makefiles/GNUstep.sh 
(
cd core/base
./configure \
    --with-layout=gnustep \
    CC=${CC} CXX=${CXX} 
)

configure:13164: checking whether objc really works
configure:13194: /usr/local/bin/clang -o conftest -g -O2  \
  -I/usr/GNUstep/System/Library/Headers -I/usr/GNUstep/Local/Library/Headers \
  -I/usr/local/include  \
  -fgnu-runtime -x objective-c  \
  -L/usr/GNUstep/System/Library/Libraries -L/usr/GNUstep/Local/Library/Libraries -L/usr/local/lib \
  conftest.c \
  -lrt  -lpthread -rdynamic -pthread \
  -fobjc-nonfragile-abi -fgnu-runtime \
  -L/home/frank/GNUstep/Library/Libraries -L/usr/GNUstep/Local/Library/Libraries \
  -L/usr/GNUstep/System/Library/Libraries -L/usr/local/lib \
  -l:libobjc.so.4.6 -lm

In file included from conftest.c:99:
In file included from ././config/config.objc.m:2:
././config/objc-common.g:53:3: warning: assignment to Objective-C's isa is deprecated in favor of object_setClass() [-Wdeprecated-objc-isa-usage]
  obj->isa = self;
  ^  ~~~~~~~
  object_setClass( , )
././config/objc-common.g:46:5: note: instance variable is declared here
 id isa;
    ^
1 warning generated.
/usr/local/lib/libobjc.so.4.6: undefined reference to `vtable for std::type_info'
/usr/local/lib/libobjc.so.4.6: undefined reference to `std::type_info::__is_function_p() const'
/usr/local/lib/libobjc.so.4.6: undefined reference to `typeinfo for std::type_info'
/usr/local/lib/libobjc.so.4.6: undefined reference to `std::type_info::~type_info()'
/usr/local/lib/libobjc.so.4.6: undefined reference to `std::type_info::__do_upcast(__cxxabiv1::__class_type_info const*, void**) const'
/usr/local/lib/libobjc.so.4.6: undefined reference to `std::type_info::__is_pointer_p() const'
clang-3.4: error: linker command failed with exit code 1 (use -v to see invocation)

_______________________________________________
Gnustep-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/gnustep-dev







reply via email to

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