Debian Codegraph @

os/linux/ccconfig.h

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 /* $Id: ccconfig.h,v 1.30 2021/08/08 23:50:10 gmcgarry Exp $ */
2
3 /*
4 * Copyright (c) 2004 Anders Magnusson ([email protected]).
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28 /*
29 * Various settings that controls how the C compiler works.
30 */
31
32 /* common cpp predefines */
33 #define CPPADD { "-D__linux__", "-D__ELF__", NULL, }
34
35 #define CRT0 "crt1.o"
36 #define GCRT0 "gcrt1.o"
37
38 #define STARTLABEL "_start"
39
40 #if defined(mach_arm)
41 #define CPPMDADD { "-D__arm__", NULL, }
42 #define DYNLINKLIB "/lib/ld-linux.so.2"
43 #elif defined(mach_i386)
44 #define CPPMDADD { "-D__i386__", NULL, }
45 #define DYNLINKLIB "/lib/ld-linux.so.2"
46 #define MUSL_DYLIB "/lib/ld-musl-i386.so.1"
•47 #elif defined(mach_arm)
48 #define CPPMDADD { "-D__arm__", NULL, }
49 #define DYNLINKLIB "/lib/ld-linux-armhf.so.3"
50 #define MUSL_ROOT "/lib/ld-musl-arm"
51 #define MUSL_HF "hf"
52 #elif defined(mach_powerpc)
53 #define CPPMDADD { "-D__ppc__", NULL, }
•54 #define DYNLINKLIB "/lib/ld.so.1"
55 #define MUSL_DYLIB "/lib/ld-musl-powerpc.so.1"
56 #elif defined(mach_amd64)
57 #include "../inc/amd64.h"
58 #define DYNLINKLIB "/lib64/ld-linux-x86-64.so.2"
59 #define MUSL_DYLIB "/lib/ld-musl-x86_64.so.1"
60 #ifndef MULTIARCH_PATH
61 #define DEFLIBDIRS { "/usr/lib64/", 0 }
62 #else
63 #define DEFLIBDIRS { "/usr/lib64/", "/usr/lib/" MULTIARCH_PATH "/", 0 }
64 #endif
65 #elif defined(mach_mips)
66 #define CPPMDADD { "-D__mips__", NULL, }
67 #define DYNLINKLIB "/lib/ld.so.1"
68 #define MUSL_ROOT "/lib/ld-musl-mips"
69 #define MUSL_EL "el"
70 #define MUSL_SF "-sf"
71 #elif defined(mach_aarch64)
72 #define CPPMDADD { "-D__aarch64__", NULL, }
73 #define MUSL_DYLIB "/lib/ld-musl-aarch64.so.1"
•74 #elif defined(mach_mips64)
75 #ifdef TARGET_BIG_ENDIAN
76 #define CPPMDADD { "-D__MIPSEB__", "-D__mips__", "-D__mips64__", "-D__LP64__", \
77 "-D_LP64", NULL }
78 #else
79 #define CPPMDADD { "-D__MIPSEL__", "-D__mips__", "-D__mipsel__", \
80 "-D__mips64__", "-D__mips64el__", "-D__LP64__", "-D_LP64", \
81 NULL }
82 #endif
83 #define DYNLINKLIB "/lib64/ld.so.1"
84 #define MUSL_ROOT "/lib/ld-musl-mips64"
85 #define MUSL_EL "el"
86 #elif defined(mach_sparc64)
87 #define CPPMDADD { "-D__sparc64__", "-D__LP64__", "-D_LP64", NULL }
88 #define DYNLINKLIB "/lib64/ld-linux.so.2"
89 #define MUSL_DYLIB "/lib/ld-musl-sparc64.so.1"
90 #elif defined(mach_m68k)
91 #define CPPMDADD { "-D__mc68000__", "-D__mc68020__", "-D__m68k__", NULL, }
92 #define DYNLINKLIB "/lib/ld.so.1"
93 #define MUSL_DYLIB "/lib/ld-musl-m68k.so.1"
94 #else
95 #error defines for arch missing
96 #endif
97
98 /*
99 * When USE_MUSL is defined, we either provide MUSL_DYLIB, or
100 * code to construct the dynamic linker name at runtime
101 */
102 #ifdef USE_MUSL
103 #ifdef MUSL_DYLIB
104 #define DYNLINKLIB MUSL_DYLIB
105 #else
106 #ifndef MUSL_EB
107 #define MUSL_EB NULL
108 #endif
109 #ifndef MUSL_EL
110 #define MUSL_EL NULL
111 #endif
112 #ifndef MUSL_SF
113 #define MUSL_SF NULL
114 #endif
115 #ifndef MUSL_HF
116 #define MUSL_HF NULL
117 #endif
118 #ifndef MUSL_EXT
119 #define MUSL_EXT ".so.1"
120 #endif
121
122 #define PCC_SETUP_LD_ARGS { \
123 char *t = MUSL_ROOT; \
124 t = cat(t, bigendian ? MUSL_EB : MUSL_EL); \
125 t = cat(t, softfloat ? MUSL_SF : MUSL_HF); \
126 dynlinklib = cat(t, MUSL_EXT); \
127 }
128 #endif
129 #endif