From 2029e03c187da531561d5ccbaa1db0423dded5c1 Mon Sep 17 00:00:00 2001 From: Roland Schatz Date: Tue, 18 Jun 2024 15:15:27 +0200 Subject: [PATCH 1/2] Build libffi with -fvisibility=hidden. We're linking libffi statically. Without visibility=hidden, then can result in name clashes with other versions of libffi that are pulled in as transitive dependencies of random other libraries. --- truffle/mx.truffle/mx_truffle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/truffle/mx.truffle/mx_truffle.py b/truffle/mx.truffle/mx_truffle.py index 69d4db858444..d7badbdad749 100644 --- a/truffle/mx.truffle/mx_truffle.py +++ b/truffle/mx.truffle/mx_truffle.py @@ -1571,7 +1571,7 @@ def getArchivableResults(self, use_relpath=True, single=False): configure_args = ['--disable-dependency-tracking', '--disable-shared', '--with-pic', - ' CFLAGS="{}"'.format(' '.join(['-g', '-O3'] + (['-m64'] if mx.get_os() == 'solaris' else []))), + ' CFLAGS="{}"'.format(' '.join(['-g', '-O3', '-fvisibility=hidden'] + (['-m64'] if mx.get_os() == 'solaris' else []))), 'CPPFLAGS="-DNO_JAVA_RAW_API"', ] From d2d505b3969472f095d574d498c4714816abb7e3 Mon Sep 17 00:00:00 2001 From: Roland Schatz Date: Wed, 19 Jun 2024 09:39:43 +0200 Subject: [PATCH 2/2] Reduce exports in libtrufflenfi.so. --- truffle/mx.truffle/suite.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/truffle/mx.truffle/suite.py b/truffle/mx.truffle/suite.py index c115349221f9..d17ad38c07d4 100644 --- a/truffle/mx.truffle/suite.py +++ b/truffle/mx.truffle/suite.py @@ -962,19 +962,19 @@ }, "linux" : { "" : { - "cflags" : ["-g", "-Wall", "-Werror", "-D_GNU_SOURCE"], + "cflags" : ["-g", "-Wall", "-Werror", "-D_GNU_SOURCE", "-fvisibility=hidden"], "ldlibs" : ["-ldl"], }, }, "linux-musl" : { "" : { - "cflags" : ["-g", "-Wall", "-Werror"], + "cflags" : ["-g", "-Wall", "-Werror", "-fvisibility=hidden"], "ldlibs" : ["-ldl"], }, }, "" : { "" : { - "cflags" : ["-g", "-Wall", "-Werror"], + "cflags" : ["-g", "-Wall", "-Werror", "-fvisibility=hidden"], "ldlibs" : ["-ldl"], }, },