Big Endian support as multi-ABI (was Re: [PATCH v4 02/15] ARC: ABI Implementation)
Vineet Gupta
Vineet.Gupta1@synopsys.com
Tue Mar 31 21:08:57 GMT 2020
On 3/26/20 11:48 AM, Joseph Myers wrote:
> Yes, if you want to support BE then it should be documented as supported,
> it should have its own dynamic linker name (with consequent GCC change
> required to use that name) and it should have its own build in
> build-many-glibcs.py.
So I booted the reworked BE support as proper multi-ABI (so abi variants in
sysdeps makefile, configure and ld versions in arc sysdeps ldconfig.h and
shlib-versions
However I'm a bit unsure about other elaborations needed per your comments in [1].
It seems they make sense when disparate ABIs can co-exit. Quoting some lines from [1]
| "support simultaneous presence of
| libraries for two different ABIs on a single system (hard-float and
| soft-float ABIs)..."
| "In cases where libraries for multiple ABIs may be present at once, there
| should be flags defined in sysdeps/generic/ldconfig.h..."
But a BE system can't possibly be mixed with a LE, its not really a multilib case
IMHO and a totally separate software stack build. So things like rewriting ldd to
be able to detect either ABI don't really apply as we need a seperate ldd built
for LE/BE for it to be even exec'ed by Linux kernel.
Going back to the list of needed parts in [1]
> sysdeps ldconfig.h file defining SYSDEP_KNOWN_INTERPRETER_NAMES with all
> the supported dynamic linker names.
Added entries for ARC LE/BE
> flags defined in sysdeps/generic/ldconfig.h to allow such libraries to be
> distinguished in ld.so.cache.
I don't see any other BE entry.
> elf/cache.c should include support for printing a corresponding description
> for those flags.
Ditto.
> sysdeps readelflib.c file that includes code to identify the flags to
> associate with a given shared library.
> sysdeps dl-cache.h defining _dl_cache_check_flags and (given that you
> use directories other than plain lib) add_system_dir.
They seem to be used for 32/64 support and/or different soft/hard float
implementation, but not for BE
> ldd_rewrite_script setting in a sysdeps configure.ac file, pointing to a
> sed script that edits ldd so that ldd installed by glibc build for any ABI
> is able to work properly for binaries of any other ABI that can execute on
> that system.
I don't see the point as it will never need to run.
Again the intent is not to reduce work for myself :-) but to do things right.
Thx,
-Vineet
[1] https://sourceware.org/legacy-ml/libc-alpha/2018-01/msg00008.html
More information about the Libc-alpha
mailing list