libobjc2 and powerpc.

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

libobjc2 and powerpc.

Bertrand Dekoninck

Hi everyone,
I'm trying to build GNUstep with CLang, libdispatch and libobjc2 on a
fresh install of Debian Jessie on powerpc32 system. I'm trying on Jessie because it's the last debian stable version for powerpc and I don't want to switch
to debian unstable for now.


I've installed the build dependencies, I've built cmake-3.7 from source, I have cloned the current libobcj2 git repo and I'm now trying to build it.

libobjc2 fails to build with stock debian clang-3.5.

It fails when building arc.m with the following :


[ 71%] Building ASM object CMakeFiles/objc.dir/block_trampolines.S.o
/home/bertrand/Install_GNUstep/libobjc2/block_trampolines.S:136:2: warning:
      imp_implementationWithBlock() not implemented for your architecture
      [-W#warnings]
#warning imp_implementationWithBlock() not implemented for your architecture
 ^
1 warning generated.
[ 75%] Building ASM object CMakeFiles/objc.dir/objc_msgSend.S.o
/home/bertrand/Install_GNUstep/libobjc2/objc_msgSend.S:14:2: warning:
      objc_msgSend() not implemented for your architecture [-W#warnings]
#warning objc_msgSend() not implemented for your architecture
 ^
1 warning generated.
[ 78%] Building C object CMakeFiles/objc.dir/NSBlocks.m.o
[ 81%] Building C object CMakeFiles/objc.dir/Protocol2.m.o
[ 84%] Building C object CMakeFiles/objc.dir/arc.m.o
/tmp/arc-feaf47.s: Messages de l'assembleur:
/tmp/arc-feaf47.s:5157: Erreur: Nom de symbole manquant dans la directive
/tmp/arc-feaf47.s:5157: Erreur: type de symbole non reconnu « .objc_sel_nameaddObject »
/tmp/arc-feaf47.s:5157: Erreur: rebut à la fin de la ligne, premier caractère non reconnu est « : »
/tmp/arc-feaf47.s:5159: Erreur: Nom de symbole manquant dans la directive
/tmp/arc-feaf47.s:5159: Erreur: rebut à la fin de la ligne, premier caractère non reconnu est « " »
/tmp/arc-feaf47.s:5160: Erreur: rebut à la fin de la ligne, premier caractère non reconnu est « " »
/tmp/arc-feaf47.s:5162: Erreur: virgule attendue après le nom «  » dans la directive .size
/tmp/arc-feaf47.s:5195: Erreur: « " »  inattendue dans l'expression
clang: error: assembler command failed with exit code 1 (use -v to see invocation)
CMakeFiles/objc.dir/build.make:670: recipe for target 'CMakeFiles/objc.dir/arc.m.o' failed
make[2]: *** [CMakeFiles/objc.dir/arc.m.o] Error 1
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/objc.dir/all' failed
make[1]: *** [CMakeFiles/objc.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

Sorry for the french parts of the message, I don't know how to temporary change my locale.

I hope someone could help here : do I need a more recent clang than clang-3.5 to build the current libobjc2 ? Will libobjc2 ever build on ppc ?


Thanks,

Bertrand






_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: libobjc2 and powerpc.

Fred Kiefer


> Am 19.03.2018 um 22:36 schrieb bertrand <[hidden email]>:
>
>
> Hi everyone,
> I'm trying to build GNUstep with CLang, libdispatch and libobjc2 on a
> fresh install of Debian Jessie on powerpc32 system. I'm trying on Jessie because it's the last debian stable version for powerpc and I don't want to switch
> to debian unstable for now.
>
>
> I've installed the build dependencies, I've built cmake-3.7 from source, I have cloned the current libobcj2 git repo and I'm now trying to build it.
>
> libobjc2 fails to build with stock debian clang-3.5.
>
> It fails when building arc.m with the following :
>
>
> [ 71%] Building ASM object CMakeFiles/objc.dir/block_trampolines.S.o
> /home/bertrand/Install_GNUstep/libobjc2/block_trampolines.S:136:2: warning:
>       imp_implementationWithBlock() not implemented for your architecture
>       [-W#warnings]
> #warning imp_implementationWithBlock() not implemented for your architecture
>  ^
> 1 warning generated.
> [ 75%] Building ASM object CMakeFiles/objc.dir/objc_msgSend.S.o
> /home/bertrand/Install_GNUstep/libobjc2/objc_msgSend.S:14:2: warning:
>       objc_msgSend() not implemented for your architecture [-W#warnings]
> #warning objc_msgSend() not implemented for your architecture
>  ^
> 1 warning generated.
> [ 78%] Building C object CMakeFiles/objc.dir/NSBlocks.m.o
> [ 81%] Building C object CMakeFiles/objc.dir/Protocol2.m.o
> [ 84%] Building C object CMakeFiles/objc.dir/arc.m.o
> /tmp/arc-feaf47.s: Messages de l'assembleur:
> /tmp/arc-feaf47.s:5157: Erreur: Nom de symbole manquant dans la directive
> /tmp/arc-feaf47.s:5157: Erreur: type de symbole non reconnu « .objc_sel_nameaddObject »
> /tmp/arc-feaf47.s:5157: Erreur: rebut à la fin de la ligne, premier caractère non reconnu est « : »
> /tmp/arc-feaf47.s:5159: Erreur: Nom de symbole manquant dans la directive
> /tmp/arc-feaf47.s:5159: Erreur: rebut à la fin de la ligne, premier caractère non reconnu est « " »
> /tmp/arc-feaf47.s:5160: Erreur: rebut à la fin de la ligne, premier caractère non reconnu est « " »
> /tmp/arc-feaf47.s:5162: Erreur: virgule attendue après le nom «  » dans la directive .size
> /tmp/arc-feaf47.s:5195: Erreur: « " »  inattendue dans l'expression
> clang: error: assembler command failed with exit code 1 (use -v to see invocation)
> CMakeFiles/objc.dir/build.make:670: recipe for target 'CMakeFiles/objc.dir/arc.m.o' failed
> make[2]: *** [CMakeFiles/objc.dir/arc.m.o] Error 1
> CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/objc.dir/all' failed
> make[1]: *** [CMakeFiles/objc.dir/all] Error 2
> Makefile:149: recipe for target 'all' failed
> make: *** [all] Error 2
>
> Sorry for the french parts of the message, I don't know how to temporary change my locale.
>
> I hope someone could help here : do I need a more recent clang than clang-3.5 to build the current libobjc2 ? Will libobjc2 ever build on ppc ?

No, a newer version of clang won’t help you here. As the message says libobjc2 is not prepared to support powerpc. You will need somebody with assembler skills for this processor to write the small piece of code needed for message sends.

Maybe David is willing to help?
_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: libobjc2 and powerpc.

David Chisnall-7
On 19 Mar 2018, at 22:06, Fred Kiefer <[hidden email]> wrote:

>
>
>
>> Am 19.03.2018 um 22:36 schrieb bertrand <[hidden email]>:
>>
>>
>> Hi everyone,
>> I'm trying to build GNUstep with CLang, libdispatch and libobjc2 on a
>> fresh install of Debian Jessie on powerpc32 system. I'm trying on Jessie because it's the last debian stable version for powerpc and I don't want to switch
>> to debian unstable for now.
>>
>>
>> I've installed the build dependencies, I've built cmake-3.7 from source, I have cloned the current libobcj2 git repo and I'm now trying to build it.
>>
>> libobjc2 fails to build with stock debian clang-3.5.
>>
>> It fails when building arc.m with the following :
>>
>>
>> [ 71%] Building ASM object CMakeFiles/objc.dir/block_trampolines.S.o
>> /home/bertrand/Install_GNUstep/libobjc2/block_trampolines.S:136:2: warning:
>>      imp_implementationWithBlock() not implemented for your architecture
>>      [-W#warnings]
>> #warning imp_implementationWithBlock() not implemented for your architecture
>> ^
>> 1 warning generated.
>> [ 75%] Building ASM object CMakeFiles/objc.dir/objc_msgSend.S.o
>> /home/bertrand/Install_GNUstep/libobjc2/objc_msgSend.S:14:2: warning:
>>      objc_msgSend() not implemented for your architecture [-W#warnings]
>> #warning objc_msgSend() not implemented for your architecture
>> ^
>> 1 warning generated.
>> [ 78%] Building C object CMakeFiles/objc.dir/NSBlocks.m.o
>> [ 81%] Building C object CMakeFiles/objc.dir/Protocol2.m.o
>> [ 84%] Building C object CMakeFiles/objc.dir/arc.m.o
>> /tmp/arc-feaf47.s: Messages de l'assembleur:
>> /tmp/arc-feaf47.s:5157: Erreur: Nom de symbole manquant dans la directive
>> /tmp/arc-feaf47.s:5157: Erreur: type de symbole non reconnu « .objc_sel_nameaddObject »
>> /tmp/arc-feaf47.s:5157: Erreur: rebut à la fin de la ligne, premier caractère non reconnu est « : »
>> /tmp/arc-feaf47.s:5159: Erreur: Nom de symbole manquant dans la directive
>> /tmp/arc-feaf47.s:5159: Erreur: rebut à la fin de la ligne, premier caractère non reconnu est « " »
>> /tmp/arc-feaf47.s:5160: Erreur: rebut à la fin de la ligne, premier caractère non reconnu est « " »
>> /tmp/arc-feaf47.s:5162: Erreur: virgule attendue après le nom «  » dans la directive .size
>> /tmp/arc-feaf47.s:5195: Erreur: « " »  inattendue dans l'expression
>> clang: error: assembler command failed with exit code 1 (use -v to see invocation)
>> CMakeFiles/objc.dir/build.make:670: recipe for target 'CMakeFiles/objc.dir/arc.m.o' failed
>> make[2]: *** [CMakeFiles/objc.dir/arc.m.o] Error 1
>> CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/objc.dir/all' failed
>> make[1]: *** [CMakeFiles/objc.dir/all] Error 2
>> Makefile:149: recipe for target 'all' failed
>> make: *** [all] Error 2
>>
>> Sorry for the french parts of the message, I don't know how to temporary change my locale.
>>
>> I hope someone could help here : do I need a more recent clang than clang-3.5 to build the current libobjc2 ? Will libobjc2 ever build on ppc ?
>
> No, a newer version of clang won’t help you here. As the message says libobjc2 is not prepared to support powerpc. You will need somebody with assembler skills for this processor to write the small piece of code needed for message sends.

There are two issues.  The first is the warnings in the libobjc2 build.  These warnings are telling you that objc_msgSend and imp_implementationWithBlock (neither of which can be implemented in C) are not available on your platform.  This means that you can’t use blocks as IMPs and you must use the older two-stage dispatch mechanism (which clang will default to for architectures where libobjc2 does not implement the objc_msgSend family).

I would be very happy to help anyone who wants to add PowerPC support to these code paths, but I personally have a very low tolerance for PowerPC assembly and no easy access to PowerPC hardware, so won’t be doing it myself.

The later errors are coming from gas, which appears not to be supporting some of the assembly that clang is generating.  You can try using -integrated-as, which tells clang to generate object code directly rather than via gas.  I don’t know what the status is for PowerPC, but a newer version might help here (PowerPC in LLVM has had a lot of work from IBM and Argone National Labs recently).

David


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: libobjc2 and powerpc.

Bertrand Dekoninck
Le mardi 20 mars 2018 à 10:46 +0000, David Chisnall a écrit :
> There are two issues.  The first is the warnings in the libobjc2 build.  These warnings are telling you that objc_msgSend and imp_implementationWithBlock (neither of which can be implemented in C) are not available on your platform.  This means that you can’t use blocks as IMPs and you must use the older two-stage dispatch mechanism (which clang will default to for architectures where libobjc2 does not implement the objc_msgSend family).
>
> I would be very happy to help anyone who wants to add PowerPC support to these code paths, but I personally have a very low tolerance for PowerPC assembly and no easy access to PowerPC hardware, so won’t be doing it myself.
>
> The later errors are coming from gas, which appears not to be supporting some of the assembly that clang is generating.  You can try using -integrated-as, which tells clang to generate object code directly rather than via gas.  I don’t know what the status is for PowerPC, but a newer version might help here (PowerPC in LLVM has had a lot of work from IBM and Argone National Labs recently).
>
> David
>

I've set CC to 'clang -integrated-as' and CXX as well. Not a complete
success. But there is some progress. It fails at link times now in
ManyManySelectors.m because objc_msgSend is called . See below.
Thanks,
Bertrand


> [  0%] Building C object CMakeFiles/objc.dir/abi_version.c.o
> [  1%] Building C object CMakeFiles/objc.dir/alias_table.c.o
> [  1%] Building C object CMakeFiles/objc.dir/block_to_imp.c.o
> [  2%] Building C object CMakeFiles/objc.dir/caps.c.o
> [  2%] Building C object CMakeFiles/objc.dir/category_loader.c.o
> [  3%] Building C object CMakeFiles/objc.dir/class_table.c.o
> [  4%] Building C object CMakeFiles/objc.dir/dtable.c.o
> [  4%] Building C object CMakeFiles/objc.dir/eh_personality.c.o
> [  5%] Building C object CMakeFiles/objc.dir/encoding2.c.o
> [  5%] Building C object CMakeFiles/objc.dir/hash_table.c.o
> [  6%] Building C object CMakeFiles/objc.dir/hooks.c.o
> [  6%] Building C object CMakeFiles/objc.dir/ivar.c.o
> [  7%] Building C object CMakeFiles/objc.dir/legacy_malloc.c.o
> [  7%] Building C object CMakeFiles/objc.dir/loader.c.o
> [  8%] Building C object CMakeFiles/objc.dir/mutation.m.o
> [  8%] Building C object CMakeFiles/objc.dir/protocol.c.o
> [  9%] Building C object CMakeFiles/objc.dir/runtime.c.o
> [ 10%] Building C object CMakeFiles/objc.dir/sarray2.c.o
> [ 10%] Building C object CMakeFiles/objc.dir/selector_table.c.o
> [ 11%] Building C object CMakeFiles/objc.dir/sendmsg2.c.o
> [ 11%] Building C object CMakeFiles/objc.dir/statics_loader.c.o
> [ 12%] Building C object CMakeFiles/objc.dir/toydispatch.c.o
> [ 12%] Building ASM object CMakeFiles/objc.dir/block_trampolines.S.o
> /home/bertrand/Install_GNUstep/libobjc2/block_trampolines.S:136:2: warning:
>       imp_implementationWithBlock() not implemented for your architecture
>       [-W#warnings]
> #warning imp_implementationWithBlock() not implemented for your architecture
>  ^
> 1 warning generated.
> [ 13%] Building ASM object CMakeFiles/objc.dir/objc_msgSend.S.o
> /home/bertrand/Install_GNUstep/libobjc2/objc_msgSend.S:14:2: warning:
>       objc_msgSend() not implemented for your architecture [-W#warnings]
> #warning objc_msgSend() not implemented for your architecture
>  ^
> 1 warning generated.
> [ 13%] Building C object CMakeFiles/objc.dir/NSBlocks.m.o
> [ 14%] Building C object CMakeFiles/objc.dir/Protocol2.m.o
> [ 15%] Building C object CMakeFiles/objc.dir/arc.m.o
> [ 15%] Building C object CMakeFiles/objc.dir/associate.m.o
> [ 16%] Building C object CMakeFiles/objc.dir/blocks_runtime.m.o
> [ 16%] Building C object CMakeFiles/objc.dir/properties.m.o
> [ 17%] Building C object CMakeFiles/objc.dir/gc_none.c.o
> [ 17%] Building CXX object CMakeFiles/objc.dir/objcxx_eh.cc.o
> clang: warning: argument unused during compilation: '-integrataed-as'
> [ 18%] Linking C shared library libobjc.so
> [ 18%] Built target objc
> [ 19%] Building C object Test/CMakeFiles/CXXExceptions_optimised.dir/CXXException.m.o
> [ 19%] Building CXX object Test/CMakeFiles/CXXExceptions_optimised.dir/CXXException.cc.o
> clang: warning: argument unused during compilation: '-integrataed-as'
> [ 20%] Building C object Test/CMakeFiles/CXXExceptions_optimised.dir/Test.m.o
> [ 20%] Linking C executable CXXExceptions_optimised
> [ 20%] Built target CXXExceptions_optimised
> [ 20%] Building C object Test/CMakeFiles/CXXExceptions.dir/CXXException.m.o
> [ 21%] Building CXX object Test/CMakeFiles/CXXExceptions.dir/CXXException.cc.o
> clang: warning: argument unused during compilation: '-integrataed-as'
> [ 22%] Building C object Test/CMakeFiles/CXXExceptions.dir/Test.m.o
> [ 22%] Linking C executable CXXExceptions
> [ 22%] Built target CXXExceptions
> [ 23%] Building C object Test/CMakeFiles/setSuperclass.dir/setSuperclass.m.o
> /home/bertrand/Install_GNUstep/libobjc2/Test/setSuperclass.m:178:30: warning:
>       'Subclass1' may not respond to 'existsOnNotInitializedSuperclass'
>                 expect([subclass1instance1 existsOnNotInitializedSuperclass]);
>                         ~~~~~~~~~~~~~~~~~~ ^
> /home/bertrand/Install_GNUstep/libobjc2/Test/setSuperclass.m:144:8: note:
>       expanded from macro 'expect'
>         if (!(x)) \
>               ^
> /home/bertrand/Install_GNUstep/libobjc2/Test/setSuperclass.m:224:30: warning:
>       'Subclass2' may not respond to 'existsOnNotInitializedSuperclass'
>                 expect([subclass2instance1 existsOnNotInitializedSuperclass]);
>                         ~~~~~~~~~~~~~~~~~~ ^
> /home/bertrand/Install_GNUstep/libobjc2/Test/setSuperclass.m:144:8: note:
>       expanded from macro 'expect'
>         if (!(x)) \
>               ^
> 2 warnings generated.
> [ 23%] Linking C executable setSuperclass
> [ 23%] Built target setSuperclass
> [ 24%] Building C object Test/CMakeFiles/hash_table_delete_optimised.dir/hash_table_delete.c.o
> [ 24%] Linking C executable hash_table_delete_optimised
> [ 24%] Built target hash_table_delete_optimised
> [ 24%] Building C object Test/CMakeFiles/exchange_optimised.dir/exchange.m.o
> [ 25%] Linking C executable exchange_optimised
> [ 25%] Built target exchange_optimised
> [ 25%] Building C object Test/CMakeFiles/exchange.dir/exchange.m.o
> [ 26%] Linking C executable exchange
> [ 26%] Built target exchange
> [ 27%] Building C object Test/CMakeFiles/zeroSizedIVar_optimised.dir/zeroSizedIVar.m.o
> [ 28%] Linking C executable zeroSizedIVar_optimised
> [ 28%] Built target zeroSizedIVar_optimised
> [ 29%] Building C object Test/CMakeFiles/MethodArguments_optimised.dir/MethodArguments.m.o
> [ 30%] Linking C executable MethodArguments_optimised
> [ 30%] Built target MethodArguments_optimised
> [ 30%] Building C object Test/CMakeFiles/NilException_optimised.dir/NilException.m.o
> [ 31%] Linking C executable NilException_optimised
> [ 31%] Built target NilException_optimised
> [ 31%] Building C object Test/CMakeFiles/NilException.dir/NilException.m.o
> [ 32%] Linking C executable NilException
> [ 32%] Built target NilException
> [ 32%] Building C object Test/CMakeFiles/msgInterpose_optimised.dir/msgInterpose.m.o
> [ 33%] Linking C executable msgInterpose_optimised
> [ 33%] Built target msgInterpose_optimised
> [ 33%] Building C object Test/CMakeFiles/hash_table_delete.dir/hash_table_delete.c.o
> [ 34%] Linking C executable hash_table_delete
> [ 34%] Built target hash_table_delete
> [ 35%] Building C object Test/CMakeFiles/msgInterpose.dir/msgInterpose.m.o
> [ 36%] Linking C executable msgInterpose
> [ 36%] Built target msgInterpose
> [ 36%] Building C object Test/CMakeFiles/BoxedForeignException_optimised.dir/BoxedForeignException.m.o
> [ 37%] Linking C executable BoxedForeignException_optimised
> [ 37%] Built target BoxedForeignException_optimised
> [ 37%] Building C object Test/CMakeFiles/AssociatedObject.dir/AssociatedObject.m.o
> [ 38%] Linking C executable AssociatedObject
> [ 38%] Built target AssociatedObject
> [ 38%] Building C object Test/CMakeFiles/Forward.dir/Forward.m.o
> [ 39%] Linking C executable Forward
> [ 39%] Built target Forward
> [ 40%] Building C object Test/CMakeFiles/ManyManySelectors_optimised.dir/ManyManySelectors.m.o
> /home/bertrand/Install_GNUstep/libobjc2/Test/ManyManySelectors.m:40:2: warning:
>       implicitly declaring library function 'objc_msgSend' with type
>       'id (id, SEL, ...)'
>         objc_msgSend([Test class], nextSel);
>         ^
> /home/bertrand/Install_GNUstep/libobjc2/Test/ManyManySelectors.m:40:2: note:
>       include the header <objc/message.h> or explicitly provide a declaration
>       for 'objc_msgSend'
> 1 warning generated.
> [ 40%] Linking C executable ManyManySelectors_optimised
> CMakeFiles/ManyManySelectors_optimised.dir/ManyManySelectors.m.o: In function `main':
> /home/bertrand/Install_GNUstep/libobjc2/Test/ManyManySelectors.m:(.text+0x340): undefined reference to `objc_msgSend'
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> Test/CMakeFiles/ManyManySelectors_optimised.dir/build.make:95: recipe for target 'Test/ManyManySelectors_optimised' failed
> make[2]: *** [Test/ManyManySelectors_optimised] Error 1
> CMakeFiles/Makefile2:872: recipe for target 'Test/CMakeFiles/ManyManySelectors_optimised.dir/all' failed
> make[1]: *** [Test/CMakeFiles/ManyManySelectors_optimised.dir/all] Error 2
> Makefile:160: recipe for target 'all' failed
> make: *** [all] Error 2


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: libobjc2 and powerpc.

David Chisnall-5
On 20 Mar 2018, at 21:30, bertrand <[hidden email]> wrote:

>
> Le mardi 20 mars 2018 à 10:46 +0000, David Chisnall a écrit :
>> There are two issues.  The first is the warnings in the libobjc2 build.  These warnings are telling you that objc_msgSend and imp_implementationWithBlock (neither of which can be implemented in C) are not available on your platform.  This means that you can’t use blocks as IMPs and you must use the older two-stage dispatch mechanism (which clang will default to for architectures where libobjc2 does not implement the objc_msgSend family).
>>
>> I would be very happy to help anyone who wants to add PowerPC support to these code paths, but I personally have a very low tolerance for PowerPC assembly and no easy access to PowerPC hardware, so won’t be doing it myself.
>>
>> The later errors are coming from gas, which appears not to be supporting some of the assembly that clang is generating.  You can try using -integrated-as, which tells clang to generate object code directly rather than via gas.  I don’t know what the status is for PowerPC, but a newer version might help here (PowerPC in LLVM has had a lot of work from IBM and Argone National Labs recently).
>>
>> David
>>
>
> I've set CC to 'clang -integrated-as' and CXX as well. Not a complete
> success. But there is some progress. It fails at link times now in
> ManyManySelectors.m because objc_msgSend is called . See below.
> Thanks,

It looks as if the library has built correctly, but some of the tests fail to compile.  The easiest thing to do is run ccmake and disable building the tests.

David


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

Bertrand Dekoninck
Le mercredi 21 mars 2018 à 07:29 +0000, David Chisnall a écrit :

> On 20 Mar 2018, at 21:30, bertrand <[hidden email]> wrote:
> >
> > Le mardi 20 mars 2018 à 10:46 +0000, David Chisnall a écrit :
> >> There are two issues.  The first is the warnings in the libobjc2 build.  These warnings are telling you that objc_msgSend and imp_implementationWithBlock (neither of which can be implemented in C) are not available on your platform.  This means that you can’t use blocks as IMPs and you must use the older two-stage dispatch mechanism (which clang will default to for architectures where libobjc2 does not implement the objc_msgSend family).
> >>
> >> I would be very happy to help anyone who wants to add PowerPC support to these code paths, but I personally have a very low tolerance for PowerPC assembly and no easy access to PowerPC hardware, so won’t be doing it myself.
> >>
> >> The later errors are coming from gas, which appears not to be supporting some of the assembly that clang is generating.  You can try using -integrated-as, which tells clang to generate object code directly rather than via gas.  I don’t know what the status is for PowerPC, but a newer version might help here (PowerPC in LLVM has had a lot of work from IBM and Argone National Labs recently).
> >>
> >> David
> >>
> >
> > I've set CC to 'clang -integrated-as' and CXX as well. Not a complete
> > success. But there is some progress. It fails at link times now in
> > ManyManySelectors.m because objc_msgSend is called . See below.
> > Thanks,
>
> It looks as if the library has built correctly, but some of the tests fail to compile.  The easiest thing to do is run ccmake and disable building the tests.
>
> David
>

Hi David and the list;

It would be usefull to run tests but I did this for now : I commented
this at the end of your CMakeLists.txt :


#if (TESTS)
# enable_testing()
# add_subdirectory(Test)
#endif (TESTS)

 I'm pretty sure there is a better way to do, but that's it : I've build
and installed libobjc2 on debian ppc. :-)

I've got a few more questions for a complete install of gnustep on
debian ppc.

My goal is to have a complete script to do this, adapted from the one
found on gnustep wiki found here :

http://wiki.gnustep.org/index.php/GNUstep_under_Ubuntu_Linux


Then I could contribute my result in it.



Here are my questions :

1. Should I install libdispatch before or after libobjc2 ?  I've seen
this warning at the end libobjc2 install :

failed to create symbolic link 'include/Block.h': No such file or
directory
-- Symlinking: include/Block.h -> include/objc/blocks_runtime.h
failed to create symbolic link 'include/Block_private.h': No such file
or directory
-- Symlinking: include/Block_private.h -> include/objc/blocks_private.h


2. Should I really build and install libdispatch from Nick Hutchinson on
github, as the wiki says ? I tried to build it but it fails. Can I use
libdispatch from debian repo instead ?


3. If not can I install libobjc2 without libdispatch ?


4. The script on the wiki builds and install gnustep-make two times :
before and after libobjc2 ? Is it still correct ?

5. For gnustep-make build, is this line still mandatory ?
"git checkout `git rev-list -1 --first-parent --before=2017-04-06
master` # fixes segfault, should probably be looked at."

Has this bug in gnustep-make been fixed since 2017-04-06 ?




Hope someone will help here.

Thanks,
Bertrand



_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

David Chisnall-7

> On 21 Mar 2018, at 13:34, bertrand <[hidden email]> wrote:
>
> Le mercredi 21 mars 2018 à 07:29 +0000, David Chisnall a écrit :
>> On 20 Mar 2018, at 21:30, bertrand <[hidden email]> wrote:
>>>
>>> Le mardi 20 mars 2018 à 10:46 +0000, David Chisnall a écrit :
>>>> There are two issues.  The first is the warnings in the libobjc2 build.  These warnings are telling you that objc_msgSend and imp_implementationWithBlock (neither of which can be implemented in C) are not available on your platform.  This means that you can’t use blocks as IMPs and you must use the older two-stage dispatch mechanism (which clang will default to for architectures where libobjc2 does not implement the objc_msgSend family).
>>>>
>>>> I would be very happy to help anyone who wants to add PowerPC support to these code paths, but I personally have a very low tolerance for PowerPC assembly and no easy access to PowerPC hardware, so won’t be doing it myself.
>>>>
>>>> The later errors are coming from gas, which appears not to be supporting some of the assembly that clang is generating.  You can try using -integrated-as, which tells clang to generate object code directly rather than via gas.  I don’t know what the status is for PowerPC, but a newer version might help here (PowerPC in LLVM has had a lot of work from IBM and Argone National Labs recently).
>>>>
>>>> David
>>>>
>>>
>>> I've set CC to 'clang -integrated-as' and CXX as well. Not a complete
>>> success. But there is some progress. It fails at link times now in
>>> ManyManySelectors.m because objc_msgSend is called . See below.
>>> Thanks,
>>
>> It looks as if the library has built correctly, but some of the tests fail to compile.  The easiest thing to do is run ccmake and disable building the tests.
>>
>> David
>>
>
> Hi David and the list;
>
> It would be usefull to run tests but I did this for now : I commented
> this at the end of your CMakeLists.txt :
>
>
> #if (TESTS)
> # enable_testing()
> # add_subdirectory(Test)
> #endif (TESTS)
>
> I'm pretty sure there is a better way to do,

Yes, run ‘ccmake .’ and toggle the enable tests line.

> but that's it : I've build
> and installed libobjc2 on debian ppc. :-)

Yay!

> I've got a few more questions for a complete install of gnustep on
> debian ppc.
>
> My goal is to have a complete script to do this, adapted from the one
> found on gnustep wiki found here :
>
> http://wiki.gnustep.org/index.php/GNUstep_under_Ubuntu_Linux
>
>
> Then I could contribute my result in it.
>
>
>
> Here are my questions :
>
> 1. Should I install libdispatch before or after libobjc2 ?  I've seen
> this warning at the end libobjc2 install :

Before, ideally.

> failed to create symbolic link 'include/Block.h': No such file or
> directory
> -- Symlinking: include/Block.h -> include/objc/blocks_runtime.h
> failed to create symbolic link 'include/Block_private.h': No such file
> or directory
> -- Symlinking: include/Block_private.h -> include/objc/blocks_private.h

That’s surprising.  Do you already have an include/Block.h?

> 2. Should I really build and install libdispatch from Nick Hutchinson on
> github, as the wiki says ? I tried to build it but it fails. Can I use
> libdispatch from debian repo instead ?

Not sure about this.  I use the one from FreeBSD packages and it appears to work...

> 3. If not can I install libobjc2 without libdispatch ?

Yes, you can.  I’m not sure if any of the live code paths actually use libdispatch anymore - I’ll aim to remove that dependency at some point.

> 4. The script on the wiki builds and install gnustep-make two times :
> before and after libobjc2 ? Is it still correct ?

No, that’s definitely wrong.  It dates back to when I tried to use GNUstep Make to build libobjc2, but that led to circular dependencies.

> 5. For gnustep-make build, is this line still mandatory ?
> "git checkout `git rev-list -1 --first-parent --before=2017-04-06
> master` # fixes segfault, should probably be looked at."
>
> Has this bug in gnustep-make been fixed since 2017-04-06

I can’t speak for Ubuntu, but that definitely isn’t needed on FreeBSD.

David



_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

Bertrand Dekoninck
Le mercredi 21 mars 2018 à 13:43 +0000, David Chisnall a écrit :

> > On 21 Mar 2018, at 13:34, bertrand <[hidden email]> wrote:
> >
> > Le mercredi 21 mars 2018 à 07:29 +0000, David Chisnall a écrit :
> >> On 20 Mar 2018, at 21:30, bertrand <[hidden email]> wrote:
> >>>
> >>> Le mardi 20 mars 2018 à 10:46 +0000, David Chisnall a écrit :
> >>>> There are two issues.  The first is the warnings in the libobjc2 build.  These warnings are telling you that objc_msgSend and imp_implementationWithBlock (neither of which can be implemented in C) are not available on your platform.  This means that you can’t use blocks as IMPs and you must use the older two-stage dispatch mechanism (which clang will default to for architectures where libobjc2 does not implement the objc_msgSend family).
> >>>>
> >>>> I would be very happy to help anyone who wants to add PowerPC support to these code paths, but I personally have a very low tolerance for PowerPC assembly and no easy access to PowerPC hardware, so won’t be doing it myself.
> >>>>
> >>>> The later errors are coming from gas, which appears not to be supporting some of the assembly that clang is generating.  You can try using -integrated-as, which tells clang to generate object code directly rather than via gas.  I don’t know what the status is for PowerPC, but a newer version might help here (PowerPC in LLVM has had a lot of work from IBM and Argone National Labs recently).
> >>>>
> >>>> David
> >>>>
> >>>
> >>> I've set CC to 'clang -integrated-as' and CXX as well. Not a complete
> >>> success. But there is some progress. It fails at link times now in
> >>> ManyManySelectors.m because objc_msgSend is called . See below.
> >>> Thanks,
> >>
> >> It looks as if the library has built correctly, but some of the tests fail to compile.  The easiest thing to do is run ccmake and disable building the tests.
> >>
> >> David
> >>
> >
> > Hi David and the list;
> >
> > It would be usefull to run tests but I did this for now : I commented
> > this at the end of your CMakeLists.txt :
> >
> >
> > #if (TESTS)
> > # enable_testing()
> > # add_subdirectory(Test)
> > #endif (TESTS)
> >
> > I'm pretty sure there is a better way to do,
>
> Yes, run ‘ccmake .’ and toggle the enable tests line.
>

I've tried it. I could put this in my gnustep_install.sh script but the
user will have to manually toggle off the tests. A commandline line
would be better.
 
Anyway, better than totally avoiding tests, I should try to see which
build and which don't, to adapt them for ppc.

> > but that's it : I've build
> > and installed libobjc2 on debian ppc. :-)
>
> Yay!
>
> > I've got a few more questions for a complete install of gnustep on
> > debian ppc.
> >
> > My goal is to have a complete script to do this, adapted from the one
> > found on gnustep wiki found here :
> >
> > http://wiki.gnustep.org/index.php/GNUstep_under_Ubuntu_Linux
> >
> >
> > Then I could contribute my result in it.
> >
> >
> >
> > Here are my questions :
> >
> > 1. Should I install libdispatch before or after libobjc2 ?  I've seen
> > this warning at the end libobjc2 install :
>
> Before, ideally.
>
> > failed to create symbolic link 'include/Block.h': No such file or
> > directory
> > -- Symlinking: include/Block.h -> include/objc/blocks_runtime.h
> > failed to create symbolic link 'include/Block_private.h': No such file
> > or directory
> > -- Symlinking: include/Block_private.h -> include/objc/blocks_private.h
>
> That’s surprising.  Do you already have an include/Block.h?
Yes it's there :  /usr/include/Block.h. Block_private.h also.

>
> > 2. Should I really build and install libdispatch from Nick Hutchinson on
> > github, as the wiki says ? I tried to build it but it fails. Can I use
> > libdispatch from debian repo instead ?
>
> Not sure about this.  I use the one from FreeBSD packages and it appears to work...

Then I will try with it.

>
> > 3. If not can I install libobjc2 without libdispatch ?
>
> Yes, you can.  I’m not sure if any of the live code paths actually use libdispatch anymore - I’ll aim to remove that dependency at some point.
>
> > 4. The script on the wiki builds and install gnustep-make two times :
> > before and after libobjc2 ? Is it still correct ?
>
> No, that’s definitely wrong.  It dates back to when I tried to use GNUstep Make to build libobjc2, but that led to circular dependencies.
>
Then should I build libobjc2 before of after gnustep-make ?

> > 5. For gnustep-make build, is this line still mandatory ?
> > "git checkout `git rev-list -1 --first-parent --before=2017-04-06
> > master` # fixes segfault, should probably be looked at."
> >
> > Has this bug in gnustep-make been fixed since 2017-04-06
>
> I can’t speak for Ubuntu, but that definitely isn’t needed on FreeBSD.
>
> David
>

Thanks.

Bertrand
>



_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

David Chisnall-7
On 21 Mar 2018, at 14:06, bertrand <[hidden email]> wrote:

>
> Le mercredi 21 mars 2018 à 13:43 +0000, David Chisnall a écrit :
>>> On 21 Mar 2018, at 13:34, bertrand <[hidden email]> wrote:
>>>
>>> pretty sure there is a better way to do,
>>
>> Yes, run ‘ccmake .’ and toggle the enable tests line.
>>
>
> I've tried it. I could put this in my gnustep_install.sh script but the
> user will have to manually toggle off the tests. A commandline line
> would be better.

-DTESTS=OFF

>
> Anyway, better than totally avoiding tests, I should try to see which
> build and which don't, to adapt them for ppc.

We should probably just disable the tests that depend on assembly for platforms that are missing the assembly.

> surprising.  Do you already have an include/Block.h?
> Yes it's there :  /usr/include/Block.h. Block_private.h also.

Okay, hopefully it’s compatible…

>>> 4. The script on the wiki builds and install gnustep-make two times :
>>> before and after libobjc2 ? Is it still correct ?
>>
>> No, that’s definitely wrong.  It dates back to when I tried to use GNUstep Make to build libobjc2, but that led to circular dependencies.
>>
> Then should I build libobjc2 before of after gnustep-make ?

After.  Now libobjc2 doesn’t depend on GNUstep Make.

David


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

Josh Freeman
In reply to this post by David Chisnall-7
On Mar 21, 2018, at 9:43 AM, David Chisnall wrote:

>> 4. The script on the wiki builds and install gnustep-make two times :
>> before and after libobjc2 ? Is it still correct ?
>
> No, that’s definitely wrong.  It dates back to when I tried to use  
> GNUstep Make to build libobjc2, but that led to circular dependencies.

    The reason for installing gnustep-make twice is that libobjc2's  
install path depends on whether gnustep-config is present (at least on  
Debian/Ubuntu): If gnustep-config is present, libobjc2 installs to /
usr/GNUstep/Local/Library/ - if not, it installs to /usr/local/lib/.

   GNUstep-make's configure won't find libobjc2 in /usr/local/lib/;  
It'll still successfully configure ("checking for custom shared objc  
library... NONE"), build, & install, but then GNUstep-base will fail  
to build - its configure will fail the "checking whether objc really  
works..." test because no runtime was found.

   So, GNUstep make's first (pre-libobjc2) install puts gnustep-config  
in place so that libobjc2 will install in a location where GNUstep  
make's second, post-libobjc2 install can find & use it as the runtime.


>> 5. For gnustep-make build, is this line still mandatory ?
>> "git checkout `git rev-list -1 --first-parent --before=2017-04-06
>> master` # fixes segfault, should probably be looked at."
>>
>> Has this bug in gnustep-make been fixed since 2017-04-06
>
> I can’t speak for Ubuntu, but that definitely isn’t needed on FreeBSD.

    That line was added as a workaround for an issue that caused all  
apps (on Debian/Ubuntu) to segfault. The issue turned out to be  
incorrect instance-variable offsets when using libobjc2's nonfragile-
abi.

    The reason the script's git-checkout command fixes the crashes is  
that until 2017-04-06, gnustep-make's build flag for setting the  
nonfragile-abi was in the wrong place, so gnustep-make builds ended up  
using the fragile-abi (incorrect abi, but no crashes); When a gnustep-
make fix for the nonfragile-abi flag was checked in on 2017-04-07,  
builds started using the correct abi, and the crashes appeared. (The  
libobjc2 ivar-offset bug was already present before then, but it was  
hidden due to using the fragile-abi).

    I posted a libobjc2 patch awhile back with a workaround, and an  
updated Ubuntu script that installs the patch & can then use the  
current gnustep-make from the trunk (rolling it back to 2017-04-06 no  
longer needed). As far as I know, that patch & script are currently  
the only way to install GNUstep on Debian/Ubuntu so that it uses the  
nonfragile-ABI (until a fix is checked into clang). This bug report  
has some more info:
https://github.com/gnustep/libobjc2/issues/52

Cheers,

Josh


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

David Chisnall-7
On 21 Mar 2018, at 19:33, Josh Freeman <[hidden email]> wrote:
>
>   The reason for installing gnustep-make twice is that libobjc2's install path depends on whether gnustep-config is present (at least on Debian/Ubuntu): If gnustep-config is present, libobjc2 installs to /usr/GNUstep/Local/Library/ - if not, it installs to /usr/local/lib/.
>
>  GNUstep-make's configure won't find libobjc2 in /usr/local/lib/; It'll still successfully configure ("checking for custom shared objc library... NONE"), build, & install, but then GNUstep-base will fail to build - its configure will fail the "checking whether objc really works..." test because no runtime was found.
>
>  So, GNUstep make's first (pre-libobjc2) install puts gnustep-config in place so that libobjc2 will install in a location where GNUstep make's second, post-libobjc2 install can find & use it as the runtime.

If you are installing on a platform that prefers /usr/lib, then the correct fix for this is to just set the prefix to /usr/ instead of /usr/local.  You don’t need to install GNUstep Make to do that.

David


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

Bertrand Dekoninck
In reply to this post by David Chisnall-7

>
> >>> 4. The script on the wiki builds and install gnustep-make two times :
> >>> before and after libobjc2 ? Is it still correct ?
> >>
> >> No, that’s definitely wrong.  It dates back to when I tried to use GNUstep Make to build libobjc2, but that led to circular dependencies.
> >>
> > Then should I build libobjc2 before of after gnustep-make ?
>
> After.  Now libobjc2 doesn’t depend on GNUstep Make.
>
> David
>

Hi everyone,
I'm trying now to build base and failed.

I've tried all that I could find on the list or on the internet:
 
- building make twice or only once after libobjc2
- installing libobjc2 in /usr , /usr/local, or even
in /usr/GNUstep/Local/Library/Libraries/ (I use GNUstep layout) by hand
- building without gcc's gobjc-4.9.deb and gobjc++-4.9.deb (I thought
they weren't mandatory) or with them.


I've even added --enable-install-ld-so-conf to gnustep-make configure.

My configure options for make are :

./configure --enable-debug-by-default --with-layout=gnustep
-enable-objc-nonfragile-abi -enable-objc-arc --enable-install-ld-so-conf

and I had set OBJCFLAGS="-fblocks -fobjc-runtime=gnustep-1.8.1" before
the last install of make and run ldconfig just before configuring base.


Each time, the configure step of base fails with the well-known and
infamous:

> checking whether objc really works... no
> I don't seem to be able to use your Objective-C compiler to produce
> working binaries!  Please check your Objective-C compiler installation.
> If you are using gcc-3.x make sure that your compiler's libgcc_s and libobjc
> can be found by the dynamic linker - usually that requires you to play
> with LD_LIBRARY_PATH or /etc/ld.so.conf.
> Please refer to your compiler installation instructions for more help.
> configure: error: The Objective-C compiler does not work or is not installed properly.

Here is attached my config log attached, when  gnustep-make was installed before and after libobjc2, ithout gobjc-4.9.

Any idea ?

Bertrand

_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

config.log (202K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

Wolfgang Lux

> Am 22.03.2018 um 10:29 schrieb bertrand <[hidden email]>:
>
>
>>
>>>>> 4. The script on the wiki builds and install gnustep-make two times :
>>>>> before and after libobjc2 ? Is it still correct ?
>>>>
>>>> No, that’s definitely wrong.  It dates back to when I tried to use GNUstep Make to build libobjc2, but that led to circular dependencies.
>>>>
>>> Then should I build libobjc2 before of after gnustep-make ?
>>
>> After.  Now libobjc2 doesn’t depend on GNUstep Make.
>>
>> David
>>
>
>
> Hi everyone,
> I'm trying now to build base and failed.
>
> I've tried all that I could find on the list or on the internet:
>
> - building make twice or only once after libobjc2
> - installing libobjc2 in /usr , /usr/local, or even
> in /usr/GNUstep/Local/Library/Libraries/ (I use GNUstep layout) by hand
> - building without gcc's gobjc-4.9.deb and gobjc++-4.9.deb (I thought
> they weren't mandatory) or with them.
>
>
> I've even added --enable-install-ld-so-conf to gnustep-make configure.
>
> My configure options for make are :
>
> ./configure --enable-debug-by-default --with-layout=gnustep
> -enable-objc-nonfragile-abi -enable-objc-arc --enable-install-ld-so-conf
>
> and I had set OBJCFLAGS="-fblocks -fobjc-runtime=gnustep-1.8.1" before
> the last install of make and run ldconfig just before configuring base.
>
>
> Each time, the configure step of base fails with the well-known and
> infamous:
>
>> checking whether objc really works... no
>> I don't seem to be able to use your Objective-C compiler to produce
>> working binaries!  Please check your Objective-C compiler installation.
>> If you are using gcc-3.x make sure that your compiler's libgcc_s and libobjc
>> can be found by the dynamic linker - usually that requires you to play
>> with LD_LIBRARY_PATH or /etc/ld.so.conf.
>> Please refer to your compiler installation instructions for more help.
>> configure: error: The Objective-C compiler does not work or is not installed properly.
>
> Here is attached my config log attached, when  gnustep-make was installed before and after libobjc2, ithout gobjc-4.9.
>
> Any idea ?

Yes. The line
  ./conftest: error while loading shared libraries: /usr/lib/libdispatch.so.0: R_PPC_REL24 relocation at 0x0fc83f40 for symbol `gettimeofday' out of range
indicates an issue with some library built incorrectly without the -fPIC option. See this Stackoverflow question for some advice:
  https://stackoverflow.com/questions/12862830/r-ppc-rel24-relocation-out-of-range

Wolfgang


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

Richard Frith-Macdonald-9
In reply to this post by Bertrand Dekoninck


> On 22 Mar 2018, at 09:29, bertrand <[hidden email]> wrote:
>
> - building make twice or only once after libobjc2

Just to be clear ... building gnustep-make twice is just a simple workaround for libobjc2 being installed in the wrong place (so it wouldn't be found and an old runtime would be found/used later) ... the initial build of gnustep-make is done to define *where* you want things installed (in your case --with-layout=gnustep) and then libobjc can use information from the gnustep-make installation to install itself in the right place.  If you want libobjc to live outside your gnustep installation, that's fine but you will then need to tell gnustep where to find it (using appropriate environment variables) unless you put it in the default location on your system (eg /usr).

> - installing libobjc2 in /usr , /usr/local, or even
> in /usr/GNUstep/Local/Library/Libraries/ (I use GNUstep layout) by hand
> - building without gcc's gobjc-4.9.deb and gobjc++-4.9.deb (I thought
> they weren't mandatory) or with them.

Manually putting libobc2 in the correct place is a perfectly fine option (installing gnustep-make first just removes the chance of making a mistake putting things in place manually).

> I've even added --enable-install-ld-so-conf to gnustep-make configure.

That should be harmless.

> My configure options for make are :
>
> ./configure --enable-debug-by-default --with-layout=gnustep
> -enable-objc-nonfragile-abi -enable-objc-arc --enable-install-ld-so-conf

You shouldn't be using -enable-objc-nonfragile-abi -enable-objc-arc unless you are sure you want to override normal behavior and know exactly wehat you are doing.  Rather, if you want to use new features yoiu should be configuring the system to use the new runtime (and hence the compiler options associated with it).  That means using -with-library-combo=ng-gnu-gnu

> and I had set OBJCFLAGS="-fblocks -fobjc-runtime=gnustep-1.8.1" before
> the last install of make and run ldconfig just before configuring base.

Also not necessary (and perhaps not helpful).
Basically, if you attempt to use new ObjC features without using the new library combo, things may go wrong, and if you use the new library combo you should not need to specify any of those old options for enabling/disabling runtime related compiler features.
I would suggest './configure --enable-debug-by-default --with-layout=gnustep  -with-library-combo=ng-gnu-gnu'

All that being said ... I don't actually think any of the configure options you aree using is actually the cause of your current problem (see below):

> Each time, the configure step of base fails with the well-known and
> infamous:
>
>> checking whether objc really works... no
>> I don't seem to be able to use your Objective-C compiler to produce
>> working binaries!  Please check your Objective-C compiler installation.
>> If you are using gcc-3.x make sure that your compiler's libgcc_s and libobjc
>> can be found by the dynamic linker - usually that requires you to play
>> with LD_LIBRARY_PATH or /etc/ld.so.conf.
>> Please refer to your compiler installation instructions for more help.
>> configure: error: The Objective-C compiler does not work or is not installed properly.

The line in the config file that's important is the error immediately before it tests for a working objc:

./conftest: error while loading shared libraries: /usr/lib/libdispatch.so.0: R_PPC_REL24 relocation at 0x0fc83f40 for symbol `gettimeofday' out of range

So the problem is with libdispatch.  I'm not the sort of linker/compiler guru who can tell you why there's a relocation issue or what to do about it though.  Possibly there are compiler flags (that you could put in CFLAGS before configuring) to deal with it, or possibly it's something wrong with the way libdispath itself was built.  



_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

Bertrand Dekoninck
Thanks all of you ! Not a success yet, but there is some progress. Base
still doesn't configure and I wonder if my libobjc2 is the culprit (see
at the end).
.

Le jeudi 22 mars 2018 à 10:37 +0000, Richard Frith-Macdonald a écrit :
>
> > On 22 Mar 2018, at 09:29, bertrand <[hidden email]> wrote:
> >
> > - building make twice or only once after libobjc2
>
> Just to be clear ... building gnustep-make twice is just a simple workaround for libobjc2 being installed in the wrong place (so it wouldn't be found and an old runtime would be found/used later) ... the initial build of gnustep-make is done to define *where* you want things installed (in your case --with-layout=gnustep) and then libobjc can use information from the gnustep-make installation to install itself in the right place.  If you want libobjc to live outside your gnustep installation, that's fine but you will then need to tell gnustep where to find it (using appropriate environment variables) unless you put it in the default location on your system (eg /usr).


> > - installing libobjc2 in /usr , /usr/local, or even
> > in /usr/GNUstep/Local/Library/Libraries/ (I use GNUstep layout) by hand
> > - building without gcc's gobjc-4.9.deb and gobjc++-4.9.deb (I thought
> > they weren't mandatory) or with them.
>
> Manually putting libobc2 in the correct place is a perfectly fine option (installing gnustep-make first just removes the chance of making a mistake putting things in place manually).

I just tried to rebuilding evrything from the start, with gnustep-make
only once and had to manually put libobjc in GNUstem/Local... to avoid
some ld failure when configure base.
> > I've even added --enable-install-ld-so-conf to gnustep-make configure.
>
> That should be harmless.
>

I didn't uses this option tis time. It had the GNUstep paths
in /etc/ld.so.conf.d/ so I fault it would cure my linker error.


> > My configure options for make are :
> >
> > ./configure --enable-debug-by-default --with-layout=gnustep
> > -enable-objc-nonfragile-abi -enable-objc-arc --enable-install-ld-so-conf
>
> You shouldn't be using -enable-objc-nonfragile-abi -enable-objc-arc unless you are sure you want to override normal behavior and know exactly wehat you are doing.  Rather, if you want to use new features yoiu should be configuring the system to use the new runtime (and hence the compiler options associated with it).  That means using -with-library-combo=ng-gnu-gnu
>
> > and I had set OBJCFLAGS="-fblocks -fobjc-runtime=gnustep-1.8.1" before
> > the last install of make and run ldconfig just before configuring base.
>
> Also not necessary (and perhaps not helpful).
> Basically, if you attempt to use new ObjC features without using the new library combo, things may go wrong, and if you use the new library combo you should not need to specify any of those old options for enabling/disabling runtime related compiler features.
> I would suggest './configure --enable-debug-by-default --with-layout=gnustep  -with-library-combo=ng-gnu-gnu'
>
I've removed the OBJCFLAGS and used your configure option.

> All that being said ... I don't actually think any of the configure options you aree using is actually the cause of your current problem (see below):
>
> > Each time, the configure step of base fails with the well-known and
> > infamous:
> >
> >> checking whether objc really works... no
> >> I don't seem to be able to use your Objective-C compiler to produce
> >> working binaries!  Please check your Objective-C compiler installation.
> >> If you are using gcc-3.x make sure that your compiler's libgcc_s and libobjc
> >> can be found by the dynamic linker - usually that requires you to play
> >> with LD_LIBRARY_PATH or /etc/ld.so.conf.
> >> Please refer to your compiler installation instructions for more help.
> >> configure: error: The Objective-C compiler does not work or is not installed properly.
>
> The line in the config file that's important is the error immediately before it tests for a working objc:
>
> ./conftest: error while loading shared libraries: /usr/lib/libdispatch.so.0: R_PPC_REL24 relocation at 0x0fc83f40 for symbol `gettimeofday' out of range
>
> So the problem is with libdispatch.  I'm not the sort of linker/compiler guru who can tell you why there's a relocation issue or what to do about it though.  Possibly there are compiler flags (that you could put in CFLAGS before configuring) to deal with it, or possibly it's something wrong with the way libdispath itself was built.  
>
>
Josh had it !
I've downloaded debian source for libdispatch, rebuilt without any
option and installed it.
No more R_PPC_24 relocation in the .so file so it's now correct. This
error doesn't appear anymore in base configuration.

But I've got another error now : a segfault in conftest

In file included from conftest.c:108:
In file included from ././config/config.objc.m:2:
././config/objc-common.g:54: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:47:5: note: instance variable is declared here
 id isa;
    ^
1 warning generated.
configure:7834: $? = 0
configure:7834: ./conftest
./configure: line 1875:  3111 Segmentation fault      ./conftest
$ac_exeext
configure:7834: $? = 139
configure: program exited with status 139
configure: failed program was:

Complete config.log attached

Thanks.



_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

config.log (198K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

Richard Frith-Macdonald-9


> On 22 Mar 2018, at 11:58, bertrand <[hidden email]> wrote:
>
> But I've got another error now : a segfault in conftest
>
> In file included from conftest.c:108:
> In file included from ././config/config.objc.m:2:
> ././config/objc-common.g:54: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:47:5: note: instance variable is declared here
> id isa;
>    ^
> 1 warning generated.
> configure:7834: $? = 0
> configure:7834: ./conftest
> ./configure: line 1875:  3111 Segmentation fault      ./conftest
> $ac_exeext
> configure:7834: $? = 139
> configure: program exited with status 139
> configure: failed program was:
>
> Complete config.log attached

That then, begins to look like a possible libobc2 bug.

The log file provides both the command used to build the test and the text of the test program (a load of defines, the tiny config/config.objc.m program, and the include of objc-common.g).
Using that you can reproduce the test executable that crashed.
You can then run it under gdb to find ot where and how the crash is occurring (look at the stack etc).




_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

Bertrand Dekoninck

>
> That then, begins to look like a possible libobc2 bug.
>
> The log file provides both the command used to build the test and the text of the test program (a load of defines, the tiny config/config.objc.m program, and the include of objc-common.g).
> Using that you can reproduce the test executable that crashed.
> You can then run it under gdb to find ot where and how the crash is occurring (look at the stack etc).
>

I've copied this into the attached conftest.c and tried to build it
with

clang -integrated-as -o conftest -g -O2
-I/usr/GNUstep/Local/Library/Headers
-I/usr/GNUstep/Local/Library/Headers
-I/usr/GNUstep/System/Library/Headers  -shared-libgcc
-L/usr/GNUstep/Local/Library/Libraries
-L/usr/GNUstep/Local/Library/Libraries
-L/usr/GNUstep/System/Library/Libraries conftest.c -lrt -ldl  -lpthread


But the compilation fails with :
In file included from conftest.c:108:
In file included from ././config/config.objc.m:2:
In file included from ././config/objc-common.g:13:
/usr/local/include/objc/Object.h:7:1: error: expected identifier or '('
@interface Object
^
/usr/local/include/objc/Object.h:11:1: error: expected identifier or '('
@end
^
In file included from conftest.c:108:
In file included from ././config/config.objc.m:2:
././config/objc-common.g:45:20: error: expected identifier or '('
GS_OBJC_ROOT_CLASS @interface NSObject
                   ^
././config/objc-common.g:49:1: error: expected identifier or '('
@end
^
././config/objc-common.g:61:1: error: expected identifier or '('
@end
^
In file included from conftest.c:108:
././config/config.objc.m:6:1: error: expected identifier or '('
@end
^
././config/config.objc.m:13:1: error: expected external declaration
+(int) testResult
^
././config/config.objc.m:13:3: error: expected identifier or '('
+(int) testResult
  ^
././config/config.objc.m:13:3: error: expected ')'
././config/config.objc.m:13:2: note: to match this '('
+(int) testResult
 ^
././config/config.objc.m:17:1: error: expected identifier or '('
@end
^
10 errors generated.

What do I miss ?
Bertrand

_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

conftest.c (7K) Download Attachment
config.objc.m (332 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

Richard Frith-Macdonald-9


> On 22 Mar 2018, at 13:49, bertrand <[hidden email]> wrote:
>
>
>>
>> That then, begins to look like a possible libobc2 bug.
>>
>> The log file provides both the command used to build the test and the text of the test program (a load of defines, the tiny config/config.objc.m program, and the include of objc-common.g).
>> Using that you can reproduce the test executable that crashed.
>> You can then run it under gdb to find ot where and how the crash is occurring (look at the stack etc).
>>
>
> I've copied this into the attached conftest.c and tried to build it
> with
>
> clang -integrated-as -o conftest -g -O2
> -I/usr/GNUstep/Local/Library/Headers
> -I/usr/GNUstep/Local/Library/Headers
> -I/usr/GNUstep/System/Library/Headers  -shared-libgcc
> -L/usr/GNUstep/Local/Library/Libraries
> -L/usr/GNUstep/Local/Library/Libraries
> -L/usr/GNUstep/System/Library/Libraries conftest.c -lrt -ldl  -lpthread

Well in the log file you attached to your previous email it says the command to build it was:

clang -integrated-as -o conftest -g -O2  -I/usr/GNUstep/Local/Library/Headers -I/usr/GNUstep/Local/Library/Headers -I/usr/GNUstep/System/Library/Headers  -x objective-c  -shared-libgcc -L/usr/GNUstep/Local/Library/Libraries -L/usr/GNUstep/Local/Library/Libraries -L/usr/GNUstep/System/Library/Libraries conftest.c -lrt -ldl  -lpthread -rdynamic -shared-libgcc -pthread -fexceptions -fobjc-runtime=gnustep-1.8 -fblocks -L/home/bertrand/GNUstep/Library/Libraries -L/usr/GNUstep/Local/Library/Libraries -L/usr/GNUstep/System/Library/Libraries -lpthread -lobjc -fobjc-nonfragile-abi -lm   -lpthread

So the problem is that you didn't copyu the command used to build the test program.

I think the lack of the '-x objective-c' is causing at least some of your problems ... without ot the compiler will see the .c file extension and assume that it's supposed to be compiling C rather than Objective-C.
To reproduce the program exactly, you should reproduce the orgiinal compilation command exactly.


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

Josh Freeman
In reply to this post by Bertrand Dekoninck
On Mar 22, 2018, at 7:58 AM, bertrand wrote:

>>>> configure: error: The Objective-C compiler does not work or is  
>>>> not installed properly.
>>
>> The line in the config file that's important is the error  
>> immediately before it tests for a working objc:
>>
>> ./conftest: error while loading shared libraries: /usr/lib/
>> libdispatch.so.0: R_PPC_REL24 relocation at 0x0fc83f40 for symbol  
>> `gettimeofday' out of range
>>
>> So the problem is with libdispatch.  I'm not the sort of linker/
>> compiler guru who can tell you why there's a relocation issue or  
>> what to do about it though.  Possibly there are compiler flags  
>> (that you could put in CFLAGS before configuring) to deal with it,  
>> or possibly it's something wrong with the way libdispath itself was  
>> built.
>>
> Josh had it !

Thanks, but that wasn't me - Richard & Wolfgang found the libdispatch  
issue.


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: GNUstep + libobjc2 and powerpc ( was "libobjc2 on powerpc")

Bertrand Dekoninck
In reply to this post by Richard Frith-Macdonald-9
Le jeudi 22 mars 2018 à 14:21 +0000, Richard Frith-Macdonald a écrit :

>
> > On 22 Mar 2018, at 13:49, bertrand <[hidden email]> wrote:
> >
> >
> >>
> >> That then, begins to look like a possible libobc2 bug.
> >>
> >> The log file provides both the command used to build the test and the text of the test program (a load of defines, the tiny config/config.objc.m program, and the include of objc-common.g).
> >> Using that you can reproduce the test executable that crashed.
> >> You can then run it under gdb to find ot where and how the crash is occurring (look at the stack etc).
> >>
> >
> > I've copied this into the attached conftest.c and tried to build it
> > with
> >
> > clang -integrated-as -o conftest -g -O2
> > -I/usr/GNUstep/Local/Library/Headers
> > -I/usr/GNUstep/Local/Library/Headers
> > -I/usr/GNUstep/System/Library/Headers  -shared-libgcc
> > -L/usr/GNUstep/Local/Library/Libraries
> > -L/usr/GNUstep/Local/Library/Libraries
> > -L/usr/GNUstep/System/Library/Libraries conftest.c -lrt -ldl  -lpthread
>
> Well in the log file you attached to your previous email it says the command to build it was:
>
> clang -integrated-as -o conftest -g -O2  -I/usr/GNUstep/Local/Library/Headers -I/usr/GNUstep/Local/Library/Headers -I/usr/GNUstep/System/Library/Headers  -x objective-c  -shared-libgcc -L/usr/GNUstep/Local/Library/Libraries -L/usr/GNUstep/Local/Library/Libraries -L/usr/GNUstep/System/Library/Libraries conftest.c -lrt -ldl  -lpthread -rdynamic -shared-libgcc -pthread -fexceptions -fobjc-runtime=gnustep-1.8 -fblocks -L/home/bertrand/GNUstep/Library/Libraries -L/usr/GNUstep/Local/Library/Libraries -L/usr/GNUstep/System/Library/Libraries -lpthread -lobjc -fobjc-nonfragile-abi -lm   -lpthread
>
> So the problem is that you didn't copyu the command used to build the test program.
>
> I think the lack of the '-x objective-c' is causing at least some of your problems ... without ot the compiler will see the .c file extension and assume that it's supposed to be compiling C rather than Objective-C.
> To reproduce the program exactly, you should reproduce the orgiinal compilation command exactly.
>
How dumb am I ? I thought I had copied it correctly?

Now I've built it and run through gdb :

Starting program: /home/bertrand/Install_GNUstep/libs-base/conftest
warning: Could not load shared library symbols for linux-vdso32.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library
"/lib/powerpc-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
__GI___pthread_mutex_init (mutex=0xff4fbcc, mutexattr=<optimized out>)
    at pthread_mutex_init.c:84
84 pthread_mutex_init.c: Aucun fichier ou dossier de ce type.


And the backtrace is :
(gdb) backtrace
#0  __GI___pthread_mutex_init (mutex=0xff4fbcc, mutexattr=<optimized
out>)
    at pthread_mutex_init.c:84
#1  0x0ff39638 in init_recursive_mutex ()
   from /usr/GNUstep/Local/Library/Libraries/libobjc.so.4.6
#2  0x0ff39274 in __objc_exec_class ()
   from /usr/GNUstep/Local/Library/Libraries/libobjc.so.4.6
#3  0x0ff45318 in .objc_load_function ()
   from /usr/GNUstep/Local/Library/Libraries/libobjc.so.4.6
#4  0xb7fdc19c in call_init (l=<optimized out>, argc=argc@entry=1,
    argv=argv@entry=0xbffff0b4, env=env@entry=0xbffff0bc) at
dl-init.c:78
#5  0xb7fdc304 in call_init (env=<optimized out>, argv=<optimized out>,
    argc=<optimized out>, l=<optimized out>) at dl-init.c:36
#6  _dl_init (main_map=0xb7fff908, argc=1, argv=0xbffff0b4,
env=0xbffff0bc)
    at dl-init.c:126
#7  0xb7fe5224 in got_label ()
at ../sysdeps/powerpc/powerpc32/dl-start.S:66
Backtrace stopped: frame did not save the PC

Should I do something else to help debugging it ?

Bertrand




_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
12