Skip to content

8343883: Cannot resolve user specified toolchain-path for lld after JDK-8338304 #21999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion make/autoconf/flags-ldflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
# Clang needs the lld linker to work correctly
BASIC_LDFLAGS="-fuse-ld=lld -Wl,--exclude-libs,ALL"
if test "x$CXX_IS_USER_SUPPLIED" = xfalse && test "x$CC_IS_USER_SUPPLIED" = xfalse; then
UTIL_REQUIRE_PROGS(LLD, lld)
UTIL_REQUIRE_PROGS(LLD, lld, $TOOLCHAIN_PATH:$PATH)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I am not 100% sure that this will work if $TOOLCHAIN_PATH is empty. You need to check that. If not, this should probably be fixed in UTIL_CHECK_PROGS instead to allow for that, since this is a more elegant solution if empty path values are allowed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call tree is UTIL_REQUIRE_PROGS -> UTIL_LOOKUP_PROGS. The UTIL_LOOKUP_PROGS seems have deal with empty path.
https://github.com/openjdk/jdk/blob/master/make/autoconf/util_paths.m4#L404
And I have verify both set $TOOLCHAIN_PATH and unset $TOOLCHAIN_PATH locally.

Copy link
Member Author

@sendaoYan sendaoYan Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have lld in $PATH but not in $TOOLCHAIN_PATH works normal.

fi
fi
if test "x$OPENJDK_TARGET_OS" = xaix; then
Expand Down