gnustep-dev
[Top][All Lists]
Advanced

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

Re: compiling GNUstep on OpenBSD - various compiler/runtime options


From: Sebastian Reitenbach
Subject: Re: compiling GNUstep on OpenBSD - various compiler/runtime options
Date: Fri, 3 Jan 2020 10:07:29 +0100

Hi


> On 3. Jan 2020, at 01:34, Riccardo Mottola <address@hidden> wrote:
> 
> Hi All!
> 
> 
> I am testing Niels' fork of make... and OpenBSD is one of the candidates, 
> since I have since long issues with gcc there. I hope we can fix it because I 
> like what Niels is doing there.
> 
> Just to make some clarity, let me sum up what is my knowledge:
> 
> We have two compilers: gcc and clang.
> 
> We have two runtime libraries: gcc one and libobjc2 in our repo by David. 
> David's runtime can be used in "gnu" and "ng" mode. Correct? However there is 
> no need to configure it, it is the same library built and installed the same 
> which then supports both (save bugs).
> 
> GCC of course supports only "gnu", its own runtime and and libobjc2 but only 
> in "gnu" mode.
> 
> Clang can be again used in both ng and gnu, but of course only with libobjc2 
> since it has no own runtime.
> 
> This gives us the following combinations possible:
> 
> 1) gcc + own runtime (make detects this config all by itself)
> 
> 2) gcc + libobjc2 (make configured with gnu-gnu-gnu)
> 
> 3) clang + libobjc2 and make configured gnu-gnu-gnu
> 
> 4) clang + libobjc2 and make configured ng-gnu-gnu
> 

The gnustep packages use option 4, you may look into gnustep.port.mk and the 
respective packages makefiles. Libobjc is installed as libobjc2. Linker is 
ld.bfd. Libobjc2 is still only 1.8, a few packages had build issues and others 
runtime issues when I tried to upgrade to libobjc2 2.0. 

cheers 
Sebastian 

> 
> Now, On OpenBSD I have a small mess:
> 
> 
> Option 1) is proven and works for me except on OpenBSD. Here it fails:
> 
> Making all for subproject ObjectiveC2...
>  Compiling file runtime.c ...
> runtime.c:35:10: fatal error: objc/objc-api.h: No such file or directory
>  #include <objc/objc-api.h>
>           ^~~~~~~~~~~~~~~~~
> compilation terminated.
> 
> I was never able to get this working, there are different revisions of objc 
> in gcc. At one point I just decided to use libobjc2 (but this stopped 
> working).
> 
> 
> Option 2), doesn't works for me either. I configure make (Niels version) like 
> this:
> 
> ./configure --prefix=/ --with-layout=gnustep CC=egcc CXX=eg++ 
> --with-library-combo=gnu-gnu-gnu
> 
> this doesn't work for me. base doesn't detect the library:
> 
> configure:6008: checking the Objective-C runtime
> configure:6018: result: GNU
> configure:6037: checking for custom shared objc library
> configure:6096: result: NONE
> 
> and then fails to get working objc:
> 
> 
> configure:7856: checking whether objc really works
> configure:7876: egcc -o conftest -g -O2  -I/Local/Library/Headers 
> -I/Local/Library/Headers -I/System/Library/Heade
> rs -I/usr/local/include  -x objective-c -L/Local/Library/Libraries 
> -L/Local/Library/Libraries -L/System/Library/L
> ibraries -L/usr/local/lib conftest.c  -lpthread -Wl,-E -pthread 
> -L/home/multix/GNUstep/Library/Libraries -L/Local/
> Library/Libraries -L/System/Library/Libraries -L/usr/local/lib -lobjc -lm     
> >&5
> In file included from /System/Library/Headers/objc/runtime.h:219,
>                  from /System/Library/Headers/objc/objc.h:1,
>                  from ./config/objc-common.g:4,
>                  from ./config/config.objc.m:2,
>                  from conftest.c:104:
> /System/Library/Headers/objc/slot.h:31:1: sorry, unimplemented: '_Atomic' in 
> Objective-C
>  OBJC_PUBLIC extern _Atomic(uint64_t) objc_method_cache_version;
>  ^~~~~~~~~~~
> configure:7876: $? = 1
> 
> 
> Option 3)
> 
> Configure make with:
> 
> ./configure --prefix=/ --with-layout=gnustep --with-library-combo=gnu-gnu-gnu
> 
> 
> checking the Objective-C runtime... GNU
> checking for custom shared objc library... NONE
> checking objc/runtime.h usability... no
> checking objc/runtime.h presence... yes
> configure: WARNING: objc/runtime.h: present but cannot be compiled
> configure: WARNING: objc/runtime.h:     check for missing prerequisite 
> headers?
> configure: WARNING: objc/runtime.h: see the Autoconf documentation
> configure: WARNING: objc/runtime.h:     section "Present But Cannot Be 
> Compiled"
> configure: WARNING: objc/runtime.h: proceeding with the compiler's result
> checking for objc/runtime.h... no
> checking objc/objc.h usability... no
> checking objc/objc.h presence... yes
> configure: WARNING: objc/objc.h: present but cannot be compiled
> configure: WARNING: objc/objc.h:     check for missing prerequisite headers?
> configure: WARNING: objc/objc.h: see the Autoconf documentation
> configure: WARNING: objc/objc.h:     section "Present But Cannot Be Compiled"
> configure: WARNING: objc/objc.h: proceeding with the compiler's result
> checking for objc/objc.h... no
> Check to make sure you have the Objective-C runtime library
> and its headers installed.
> configure: error: Could not find Objective-C headers
> 
> 
> Option 4)
> 
> Make configured with:
> 
> ./configure --prefix=/ --with-layout=gnustep --with-library-combo=ng-gnu-gnu
> 
> 
> here configure works, but then compile fails:
> 
>  Linking tool cvtenc ...
> ld: error: undefined symbol: _Unwind_Resume
> >>> referenced by cvtenc.m:0
> >>> ./obj/cvtenc.obj/cvtenc.m.o:(gnustep_base_user_main)
>  Compiling file AGSParser.m ...
> clang: error: linker command failed with exit code 1 (use -v to see 
> invocation)
> 
> and here starts a dilemma. I tried as a workaround:
> 
>  ./configure LDFLAGS=-lstdc++
> 
> (used then also for gui, back...) and added to compile Ink.
> 
> But then, a test test run ends like this:
> 
> Program received signal SIGFPE, Arithmetic exception.
> 0x000002b46e5fd66f in ?? () from /usr/libexec/ld.so
> (gdb) bt
> #0  0x000002b46e5fd66f in ?? () from /usr/libexec/ld.so
> #1  0x000002b44f363c00 in ?? ()
> #2  0x0000000000000000 in ?? ()
> 
> 
> Riccardo
> 
> 




reply via email to

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