Skip to content

Commit 8e865ac

Browse files
committed
update to build with clang 15
1 parent 8f38fe7 commit 8e865ac

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

osmesa-install.sh

+25-1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ if [ "$osname" = Darwin ]; then
9191
# 19: macOS 10.15 Catalina
9292
# 20: macOS 11 Big Sur
9393
# 21: macOS 12 Monterey
94+
# 22: macOS 13 Ventura
95+
# 23: macOS 14 Sonoma
9496

9597
if [ "$osver" = 10 ]; then
9698
# On Snow Leopard (10.6), build universal
@@ -367,7 +369,9 @@ if [ "$osmesadriver" = 3 ] || [ "$osmesadriver" = 4 ]; then
367369
if [ "$buildllvm" = 0 ]; then
368370
# advise user to turn on automatic download, build and install option
369371
echo "Error: $llvmconfigbinary does not exist, set environment variable LLVM_BUILD to 1 to automatically download and install llvm, as in:"
370-
echo " env LLVM_BUILD=1 $0"
372+
echo " env LLVM_BUILD=1 $0"
373+
echo "Or alternatively give the path to an existing LLVM installation as in:"
374+
echo " env LLVM_PREFIX=/opt/local/libexec/llvm-6.0 $0"
371375
else
372376
echo "Error: $llvmconfigbinary does not exist, please install LLVM with RTTI support in $llvmprefix"
373377
echo " download the LLVM sources from llvm.org, and configure it with:"
@@ -381,7 +385,13 @@ if [ "$osmesadriver" = 3 ] || [ "$osmesadriver" = 4 ]; then
381385
echo "LLVM 4.0.1 is the best option for Mesa 17.x."
382386
echo "LLVM 6.0.1 works with Mesa 18.x."
383387
echo "LLVM 9.0.1 hangs on osdemo16, at least up to Mesa 18.2.8, but may work with Mesa 18.3.6 and later."
388+
echo "LLVM 15 and greater will NOT work, because of:"
389+
echo " - https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179/11 (LLVM 15)"
390+
echo " - https://llvm.org/docs/OpaquePointers.html#frontends (LLVM 16)"
384391
echo "Please modify this script and file a github issue if it works with this version."
392+
if version_gt $("$llvmconfigbinary" --version) 14.99; then
393+
exit 1
394+
fi
385395
echo "Continuing anyway after 10s."
386396
sleep 10
387397
fi
@@ -422,6 +432,13 @@ if version_gt $("$llvmconfigbinary" --version) 6.0.1 && version_gt 19.0.0 "$mesa
422432
echo "Building for an unsupported combination of Mesa/LLVM."
423433
echo "LLVM 6.0.1 is the best option for Mesa 18.x."
424434
echo "LLVM 9.0.1 and later hang when running osdemo16 with Mesa up to 18.1.8."
435+
echo "LLVM 15 and greater will NOT work, because of:"
436+
echo " - https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179/11 (LLVM 15)"
437+
echo " - https://llvm.org/docs/OpaquePointers.html#frontends (LLVM 16)"
438+
echo "Please modify this script and file a github issue if it works with this version."
439+
if version_gt $("$llvmconfigbinary" --version) 14.99; then
440+
exit 1
441+
fi
425442
echo "Continuing anyway after 10s."
426443
sleep 10
427444
fi
@@ -520,6 +537,8 @@ if [ "$osname" = Darwin ]; then
520537
patch-include-GL-mesa_glinterop_h.diff \
521538
missing_clock_gettime.patch \
522539
"
540+
SED=gsed
541+
export SED
523542
fi
524543

525544
for i in $PATCHES; do
@@ -631,6 +650,7 @@ elif [ "$use_autoconf" = 1 ]; then
631650

632651
test -f Mafefile && make -j"${mkjobs}" distclean # if in an existing build
633652

653+
autoupdate
634654
autoreconf -fi
635655

636656
platformsopt="--with-platforms="
@@ -736,6 +756,10 @@ elif [ "$use_autoconf" = 1 ]; then
736756
if [ -n "${SDKROOT+x}" ]; then
737757
osxflags="$osxflags -isysroot $SDKROOT"
738758
fi
759+
# clang >= 15 started treating int <-> ptr conversions as errors
760+
if [ "$CC" = "clang" ]; then
761+
osxflags="$osxflags -Wno-int-conversion"
762+
fi
739763

740764
if [ -n "$osxflags" ]; then
741765
CFLAGS="$CFLAGS $osxflags"

0 commit comments

Comments
 (0)