[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: building libobjc2 fPIC issue and ccmake . effectiveness
From: |
Riccardo Mottola |
Subject: |
Re: building libobjc2 fPIC issue and ccmake . effectiveness |
Date: |
Mon, 1 Jun 2020 12:31:48 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 |
Hi,
On 5/31/20 1:05 PM, David Chisnall wrote:
On 30 May 2020, at 22:51, Riccardo Mottola <riccardo.mottola@libero.it> wrote:
I have libstdc++.so and libstdc++.a available, and libsupc++.a
so I use ccmake. and set
CXX_RUNTIME_LIB to /usr/lib/libstdc++.so
then I run (c)onfigure and (g)enerate - at that point libobjc2 fully built and
installed.
Great! I am a bit confused as to why it’s finding the .a, because that should
be looking for only libraries that end with ${CMAKE_SHARED_LIBRARY_SUFFIX},
which should be .so on ELF platforms. We might need an extra check here.
Yes, it is strange indeed. Is there a configure log I can see or check?
Like a config.log or so from autotools.
This looks as if it is not finding the stringWithFormat:arguments: method.
This is in -base additions. Are you linking with BFD ld? This looks like
stack trace that I’d expect if Additions is not being loaded, which was the bug
we saw with BFD LD. Can you try using a different linker for -base?
I always used the netbsd base linker. It does work with gcc and gcc
runtime and gnustep-base.
GNU ld (NetBSD Binutils nb1) 2.31.1
I reconfigured base with:
./configure LD=/usr/pkg/gnu/bin/ld.gold
Is that enough?
./configure CFLAGS=-fuse-ld=gold
does not work with clang.
However, I still get the same crash. I wonder however if the old linker
is really being used or not!
./configure LDFLAGS=-fuse-ld=gold
also does not work....
I have clang 9.0.1
Then I thought... let's try "make test" in libobjc2
98% tests passed, 4 tests failed out of 186
Total Test time (real) = 68.32 sec
The following tests FAILED:
25 - BlockImpTest (SEGFAULT)
26 - BlockImpTest_optimised (SEGFAULT)
27 - BlockImpTest_legacy (SEGFAULT)
28 - BlockImpTest_legacy_optimised (SEGFAULT)
are these expected? I suppose... not, but I wonder if they can cause the issue
I am seeing.
These are four variations of the same test (-O0 / -O2, ABIv1 / ABIv2). I would
expect the objc_msgSend tests to fail as well if it’s a problem with assembly
paths. Is this OpenBSD? As I recall, OpenBSD has some restrictions on JIT’d
code (which is what these paths are doing, effectively). Can you look at the
mmap / mprotect calls in block_to_imp in these tests (these tests are all in
the Tests/ subdirectory of your build directory and the versions without the
_optimised suffix should work well in a debugger) and see if either of them are
failing?
David
this is the "right track". I am on NetBSD, which has paxctl for memory
access.
I did:
paxctl +m Test/BlockImpTest*
And rerun:
100% tests passed, 0 tests failed out of 186
so this looks great now! I hope that once finding the way to fix
linking, everything will work on NetBSD too with clang. First time I try
it (I used it 2 years ago, but in gnu compatibility mode)
Riccardo
- Re: building libobjc2 fPIC issue and ccmake . effectiveness,
Riccardo Mottola <=