Gentoo Archives: gentoo-dev

From: Nikos Chantziaras <realnc@×××××.com>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Header files and ABI_X86
Date: Thu, 22 Aug 2013 07:56:55
Message-Id: kv4g70$g23$1@ger.gmane.org
1 Now that Gentoo is much better in handling multilib libraries, but
2 Gentoo is source-based, there's the question of which header files are
3 used between different ABI builds.
4
5 As I understand it, only the headers from the default ABI are installed.
6 That means that building for abi_x86_32 on a amd64 system will use the
7 headers installed by the abi_x86_64 build of the used library.
8
9 From a developer's point of view, does that mean that we now have to
10 keep Gentoo in mind when writing header files, or does Gentoo apply any
11 kind of magic here to fix differences between header files for different
12 archs? For example, if I need to provide a PTR_SIZE macro in a header
13 that contains the size of void pointers on this particular system, I
14 would detect this with autoconf and then just use that, so the header
15 file would end up simply containing:
16
17 #define PTR_SIZE 8
18
19 on x86-64, and:
20
21 #define PTR_SIZE 4
22
23 on x86. The x86-64 header won't work properly when building on Gentoo
24 for abi_x86_32. As a developer, this is a no-no for me:
25
26 #ifdef THIS_ARCH
27 #define PTR_SIZE 8
28 #elif defined THAT_ARCH
29 #define PTR_SIZE 4
30 ...
31
32 because detection should be done in autoconf, not in the header file.
33
34 So how does Gentoo solve that problem?

Replies

Subject Author
Re: [gentoo-dev] Header files and ABI_X86 "Michał Górny" <mgorny@g.o>