mesa-gl:moved to "simplified /usr" and towards RCS
[nyanlinux.git] / builders / mesa-gl-amd-sh-ddf2ca4faffdd309638aa0ebfcba2c43b4fc439d / contrib / gcc_binutils.sh
blob5ddd37fa2bdf1793fe2e034f2e7a4b9ffccd8b28
1 # toolchain configuration, default to gcc
2 #===============================================================================
3 if test "${cpp-unset}" = unset; then
4 cpp="/opt/toolchains/x64/elf/binutils-gcc/current/bin/x86_64-pc-linux-gnu-gcc \
5 -nostdinc \
6 -fPIC \
7 -fpic \
8 -ftls-model=global-dynamic \
9 -E \
12 # the geniuses writting compilers may have c++ required hardcoded definitions
13 # in the c++ preprocessor to be able to compile code...
14 if test "${cxxpp-unset}" = unset; then
15 # XXX: you must pass -fno-rtti here to disable __GXX_RTTI and -fno-exceptions to
16 # disable __EXCEPTIONS
17 # OMFG... c++...
18 cxxpp="/opt/toolchains/x64/elf/binutils-gcc/current/bin/x86_64-pc-linux-gnu-g++ \
19 -fno-rtti \
20 -fno-exceptions \
21 -fPIC \
22 -fpic \
23 -ftls-model=global-dynamic \
24 -nostdinc \
25 -E \
28 # c/c++ compiler specific fixed includes are based on the syslib at compiler build time, COMPILER
29 # BUILD TIME... oh god... must be found first to override the syslib ones...
30 if test "${cc_internal_fixed_incdir-unset}" = unset; then
31 cc_internal_fixed_incdir=/opt/toolchains/x64/elf/binutils-gcc/current/lib/gcc/x86_64-pc-linux-gnu/13.2.0/include-fixed
33 # c/c++ compiler specific stdarg.h stddef.h etc...
34 if test "${cc_internal_incdir-unset}" = unset; then
35 cc_internal_incdir=/opt/toolchains/x64/elf/binutils-gcc/current/lib/gcc/x86_64-pc-linux-gnu/13.2.0/include
37 # c++ compiler specific includes
38 if test "${cxx_internal_incdir-unset}" = unset; then
39 cxx_internal_incdir=/opt/toolchains/x64/elf/binutils-gcc/current/include/c++/13.2.0
41 #===============================================================================
42 if test "${cc_s-unset}" = unset; then
43 cc_s="/opt/toolchains/x64/elf/binutils-gcc/current/bin/x86_64-pc-linux-gnu-gcc \
44 -pipe \
45 -std=c99 \
46 -O2 -Wno-stringop-overflow \
47 -fvisibility=hidden \
48 -static-libgcc \
49 -fPIC \
50 -fpic \
51 -ftls-model=global-dynamic \
52 -S"
54 # aco is c++ crap from 2017, did not check AMD addrlib c++ diarrhea
55 if test "${cxx_s-unset}" = unset; then
56 cxx_s="/opt/toolchains/x64/elf/binutils-gcc/current/bin/x86_64-pc-linux-gnu-g++ \
57 -pipe \
58 -std=c++17 \
59 -fno-rtti \
60 -fno-exceptions \
61 -O2 -Wno-stringop-overflow \
62 -fvisibility=hidden \
63 -static-libgcc \
64 -static-libstdc++ \
65 -fPIC \
66 -fpic \
67 -ftls-model=global-dynamic \
68 -S"
70 #-------------------------------------------------------------------------------
71 if test "${binutils_ld-unset}" = unset; then
72 binutils_ld=/opt/toolchains/x64/elf/binutils-gcc/current/bin/ld
74 #-------------------------------------------------------------------------------
75 # Compiler generic support libraries. In the case of gcc it is libgcc, for tinycc
76 # it is libtcc1, etc.
77 # Even with -fno-exceptions, many libstdc++ objects will pull libgcc_eh, OMFG.
78 # We want a full pathname. With gcc, you can discover the pathnames with:
79 # "gcc -print-file-name=libgcc.a" and "gcc -print-file-name=libgcc_eh.a"
80 if test "${cc_ld_support_lib-unset}" = unset; then
81 eval cc_ld_support_lib=$($cc_s -print-file-name=libgcc.a)
83 if test "${cc_ld_eh_support_lib-unset}" = unset; then
84 eval cc_ld_eh_support_lib=$($cc_s -print-file-name=libgcc_eh.a)
86 #-------------------------------------------------------------------------------
87 # Compiler c++ runtime.
88 # We want a full pathname. With gcc, you can discover the pathname with:
89 # "gcc -print-file-name=libstdc++.a"
90 if test "${cxx_runtime_lib-unset}" = unset; then
91 eval cxx_runtime_lib=$($cxx_s -print-file-name=libstdc++.a)
93 #-------------------------------------------------------------------------------
94 # Compiler specific start/end files for linking a Shared LIBrary (slib), they
95 # appear after/before the syslib start/end files while linking. Here, as an
96 # example, look at the compiler driver $gcc_src/gcc/config/gnu-user.h (13.2.0)
97 # if you want to understand a bit more in the case of glibc, shared libs do fall
98 # in the "shared" category.
99 # With gcc, their pathname can be discovered with:
100 # "gcc -print-file-name=crtbeginS.o" and "gcc -print-file-name=crtendS.o"
101 if test "${cc_ld_slib_start_files-unset}" = unset; then
102 eval cc_ld_slib_start_files=$($cc_s -print-file-name=crtbeginS.o)
104 if test "${cc_ld_slib_end_files-unset}" = unset; then
105 eval cc_ld_slib_end_files=$($cc_s -print-file-name=crtendS.o)
107 #===============================================================================
108 if test "${as-unset}" = unset; then
109 as=/opt/toolchains/x64/elf/binutils-gcc/current/bin/as
111 #===============================================================================
112 if test "${ar_rcs-unset}" = unset; then
113 ar_rcs='/opt/toolchains/x64/elf/binutils-gcc/current/bin/ar rcs'
115 #===============================================================================
116 # gcc-like built-in
117 cc_builtins_cpp_flags_defs="\
118 -DHAVE___BUILTIN_BSWAP32=1 \
119 -DHAVE___BUILTIN_BSWAP64=1 \
120 -DHAVE___BUILTIN_CLZ=1 \
121 -DHAVE___BUILTIN_CLZLL=1 \
122 -DHAVE___BUILTIN_CTZ=1 \
123 -DHAVE___BUILTIN_EXPECT=1 \
124 -DHAVE___BUILTIN_FFS=1 \
125 -DHAVE___BUILTIN_FFSLL=1 \
126 -DHAVE___BUILTIN_POPCOUNT=1 \
127 -DHAVE___BUILTIN_POPCOUNTLL=1 \
128 -DHAVE___BUILTIN_UNREACHABLE=1 \
129 -DUSE_GCC_ATOMIC_BUILTINS=1 \
131 #-------------------------------------------------------------------------------
132 # gcc-like attributes
133 cc_attributes_cpp_flags_defs="\
134 -DHAVE_FUNC_ATTRIBUTE_CONST=1 \
135 -DHAVE_FUNC_ATTRIBUTE_FLATTEN=1 \
136 -DHAVE_FUNC_ATTRIBUTE_MALLOC=1 \
137 -DHAVE_FUNC_ATTRIBUTE_PURE=1 \
138 -DHAVE_FUNC_ATTRIBUTE_UNUSED=1 \
139 -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT=1 \
140 -DHAVE_FUNC_ATTRIBUTE_WEAK=1 \
142 -DHAVE_FUNC_ATTRIBUTE_FORMAT=1 \
143 -DHAVE_FUNC_ATTRIBUTE_PACKED=1 \
144 -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL=1 \
145 -DHAVE_FUNC_ATTRIBUTE_VISIBILITY=1 \
146 -DHAVE_FUNC_ATTRIBUTE_ALIAS=1 \
147 -DHAVE_FUNC_ATTRIBUTE_NORETURN=1 \