@@ -194,12 +194,10 @@ function gcc_script(compiler_target::Platform)
194194 done
195195 fi
196196
197+ # Install libtapi
197198 mkdir -p ${WORKSPACE}/srcdir/apple-libtapi/build
198199 cd ${WORKSPACE}/srcdir/apple-libtapi/build
199-
200200 export TAPIDIR=${WORKSPACE}/srcdir/apple-libtapi
201-
202- # Install libtapi
203201 cmake ../src/llvm \
204202 -DCMAKE_CXX_FLAGS="-I${TAPIDIR}/src/llvm/projects/clang/include -I${TAPIDIR}/build/projects/clang/include" \
205203 -DLLVM_INCLUDE_TESTS=OFF \
@@ -210,14 +208,55 @@ function gcc_script(compiler_target::Platform)
210208 make install
211209
212210 # Install cctools
211+ cd ${WORKSPACE}/srcdir/cctools-port/cctools
212+ ./autogen.sh
213213 mkdir -p ${WORKSPACE}/srcdir/cctools_build
214214 cd ${WORKSPACE}/srcdir/cctools_build
215- CC=/usr/bin/clang CXX=/usr/bin/clang++ LDFLAGS=-L/usr/lib ${WORKSPACE}/srcdir/cctools-port/cctools/configure \
215+ # CC=/usr/bin/clang CXX=/usr/bin/clang++ LDFLAGS=-L/usr/lib ${WORKSPACE}/srcdir/cctools-port/cctools/configure \
216+ # --prefix=${prefix} \
217+ # --target=${COMPILER_TARGET} \
218+ # --host=${MACHTYPE} \
219+ # --with-libtapi=${prefix}
220+
221+ # Does not work:
222+ # CFLAGS="-isysroot ${sysroot}"
223+ # CXXFLAGS="-isysroot ${sysroot}"
224+ # CPPFLAGS="-isystem ${sysroot}/usr/include"
225+ # CPPFLAGS="-isystem /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/usr/include"
226+ # CPPFLAGS="-isystem /workspace/x86_64-apple-darwin14/destdir/x86_64-apple-darwin14/sys-root/System/Library/Frameworks/Kernel.framework/Versions/A/Headers"
227+
228+ # $sysroot:
229+ # /workspace/destdir/x86_64-apple-darwin14/sys-root
230+ # find:
231+ # /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/usr/include/sys/cdefs.h
232+ # /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/cdefs.h
233+ # /workspace/srcdir/cctools-port/cctools/include/sys/cdefs.h
234+ # /workspace/srcdir/gcc-14.2.0/fixincludes/tests/base/sys/cdefs.h
235+ # /workspace/srcdir/MacOSX10.12.sdk/usr/include/sys/cdefs.h
236+ # /workspace/srcdir/MacOSX10.12.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/cdefs.h
237+ # /workspace/x86_64-apple-darwin14/destdir/x86_64-apple-darwin14/sys-root/usr/include/sys/cdefs.h
238+ # /workspace/x86_64-apple-darwin14/destdir/x86_64-apple-darwin14/sys-root/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/cdefs.h
239+
240+ # find / -name cdefs.h >CDEFS-LOCS
241+ # /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/usr/include/sys/cdefs.h
242+ # /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/cdefs.h
243+ # /workspace/srcdir/cctools-port/cctools/include/sys/cdefs.h
244+ # /workspace/srcdir/gcc-14.2.0/fixincludes/tests/base/sys/cdefs.h
245+ # /workspace/srcdir/MacOSX10.12.sdk/usr/include/sys/cdefs.h
246+ # /workspace/srcdir/MacOSX10.12.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/cdefs.h
247+ # /workspace/x86_64-apple-darwin14/destdir/x86_64-apple-darwin14/sys-root/usr/include/sys/cdefs.h
248+ # /workspace/x86_64-apple-darwin14/destdir/x86_64-apple-darwin14/sys-root/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/cdefs.h
249+
250+ ${WORKSPACE}/srcdir/cctools-port/cctools/configure \
216251 --prefix=${prefix} \
217252 --target=${COMPILER_TARGET} \
218253 --host=${MACHTYPE} \
219- --with-libtapi=${prefix}
220- make -j${nproc}
254+ CC=/usr/bin/clang \
255+ CXX=/usr/bin/clang++ \
256+ CPPFLAGS="-I/workspace/x86_64-apple-darwin14/destdir/x86_64-apple-darwin14/sys-root/System/Library/Frameworks/Kernel.framework/Versions/A/Headers" \
257+ LDFLAGS=-L/usr/lib
258+ #TODO make -j${nproc}
259+ make
221260 make install
222261
223262 # Otherwise, we need to install binutils first
@@ -367,7 +406,10 @@ function gcc_script(compiler_target::Platform)
367406 # modern version of C, too modern for the old glibc libraries we are
368407 # trying to build. Various configure tests would fail otherwise. (Why
369408 # declare variables or functions if they default to int anyway?)
370- GLIBC_CFLAGS="${CFLAGS} -g -O2 -Wno-implicit-int -Wno-implicit-function-declaration -Wno-builtin-declaration-mismatch -Wno-array-parameter"
409+ GLIBC_CFLAGS="${CFLAGS} -g -O2"
410+ if test -d ${WORKSPACE}/srcdir/gcc-14*; then
411+ GLIBC_CFLAGS="${GLIBC_CFLAGS} -Wno-implicit-int -Wno-implicit-function-declaration -Wno-builtin-declaration-mismatch -Wno-array-parameter -Wno-int-conversion"
412+ fi
371413
372414
373415 # Configure glibc
0 commit comments