Skip to content

Commit e0c2cb4

Browse files
author
Joachim Kern
committed
8348663: [AIX] clang pollutes the burned-in library search paths of the generated executables
Reviewed-by: ihse, clanger, mbaesken
1 parent 14136f8 commit e0c2cb4

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

make/autoconf/basic.m4

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -624,4 +624,10 @@ AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
624624
625625
# Make the compare script executable
626626
$CHMOD +x $OUTPUTDIR/compare.sh
627+
628+
# Copy the linker wrapper script for clang on AIX and make it executable
629+
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
630+
$CP -f "$TOPDIR/make/scripts/aix/ld.sh" "$OUTPUTDIR/ld.sh"
631+
$CHMOD +x "$OUTPUTDIR/ld.sh"
632+
fi
627633
])

make/autoconf/flags-ldflags.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -79,7 +79,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
7979
fi
8080
if test "x$OPENJDK_TARGET_OS" = xaix; then
8181
BASIC_LDFLAGS="-Wl,-b64 -Wl,-brtl -Wl,-bnorwexec -Wl,-bnolibpath -Wl,-bnoexpall \
82-
-Wl,-bernotok -Wl,-bdatapsize:64k -Wl,-btextpsize:64k -Wl,-bstackpsize:64k"
82+
-Wl,-bernotok -Wl,-bdatapsize:64k -Wl,-btextpsize:64k -Wl,-bstackpsize:64k -fuse-ld=$OUTPUTDIR/ld.sh"
8383
BASIC_LDFLAGS_JVM_ONLY="$BASIC_LDFLAGS_JVM_ONLY -Wl,-lC_r -Wl,-bbigtoc"
8484
fi
8585

make/scripts/aix/ld.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (c) 2025 SAP SE. All rights reserved.
4+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5+
#
6+
# This code is free software; you can redistribute it and/or modify it
7+
# under the terms of the GNU General Public License version 2 only, as
8+
# published by the Free Software Foundation. Oracle designates this
9+
# particular file as subject to the "Classpath" exception as provided
10+
# by Oracle in the LICENSE file that accompanied this code.
11+
#
12+
# This code is distributed in the hope that it will be useful, but WITHOUT
13+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15+
# version 2 for more details (a copy is included in the LICENSE file that
16+
# accompanied this code).
17+
#
18+
# You should have received a copy of the GNU General Public License version
19+
# 2 along with this work; if not, write to the Free Software Foundation,
20+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21+
#
22+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23+
# or visit www.oracle.com if you need additional information or have any
24+
# questions.
25+
#
26+
unset LIBPATH
27+
exec /usr/bin/ld "$@"

0 commit comments

Comments
 (0)