-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LLD] [MinGW] Reinstate the former spelling in the version message #97698
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
Conversation
@llvm/pr-subscribers-lld Author: Martin Storsjö (mstorsjo) Changes0f9fbbb changed the version printouts. This broke linker detection in Meson, when disambiguating between the ld.lld and lld-link interfaces, in Reinstate the parentheses in the printout here, for compatibility with Meson. The printout looks a little odd in this form, "LLD 19.0.0 (https://github.com/llvm/llvm-project 173514d) (compatible with GNU linkers)", but works with Meson. The Meson check should ideally be loosened. But even then, we should only change LLD to the new form once older versions of Meson aren't used for these targets any longer, i.e. earliest within a few years. Full diff: https://github.com/llvm/llvm-project/pull/97698.diff 2 Files Affected:
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp
index 1fd120ad3601d..35fd478a21905 100644
--- a/lld/MinGW/Driver.cpp
+++ b/lld/MinGW/Driver.cpp
@@ -199,7 +199,7 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
// a GNU compatible linker. As long as an output for the -v option
// contains "GNU" or "with BFD", they recognize us as GNU-compatible.
if (args.hasArg(OPT_v) || args.hasArg(OPT_version))
- message(getLLDVersion() + ", compatible with GNU linkers");
+ message(getLLDVersion() + " (compatible with GNU linkers)");
// The behavior of -v or --version is a bit strange, but this is
// needed for compatibility with GNU linkers.
diff --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test
index 44ec58818e0bf..b723c0ad98749 100644
--- a/lld/test/MinGW/driver.test
+++ b/lld/test/MinGW/driver.test
@@ -268,7 +268,7 @@ APPCONTAINER: -appcontainer
RUN: ld.lld -m i386pep --version 2>&1 | FileCheck -check-prefix=VERSION %s
RUN: ld.lld -m i386pep -v 2>&1 | FileCheck -check-prefix=VERSION %s
RUN: not ld.lld -m i386pep -v xyz 2>&1 | FileCheck -check-prefix=VERSION %s
-VERSION: LLD {{.*}}, compatible with GNU linkers
+VERSION: LLD {{.*}} (compatible with GNU linkers)
RUN: ld.lld -m i386pep --help 2>&1 | FileCheck -check-prefix=HELP %s
HELP: USAGE:
|
Don't require the string to be enclosed in parentheses. llvm/llvm-project#97323 changed the LLD version printout to no longer be enclosed in parentheses, which made Meson fail to detect the linker style used here. The LLD change is being reverted in llvm/llvm-project#97698 in order to fix building with existing Meson versions, but for the future, loosen the check slightly, to not require the parentheses.
@@ -268,7 +268,7 @@ APPCONTAINER: -appcontainer | |||
RUN: ld.lld -m i386pep --version 2>&1 | FileCheck -check-prefix=VERSION %s | |||
RUN: ld.lld -m i386pep -v 2>&1 | FileCheck -check-prefix=VERSION %s | |||
RUN: not ld.lld -m i386pep -v xyz 2>&1 | FileCheck -check-prefix=VERSION %s | |||
VERSION: LLD {{.*}}, compatible with GNU linkers | |||
VERSION: LLD {{.*}} (compatible with GNU linkers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider a link to
mesonbuild/meson#13383
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks!
Don't require the string to be enclosed in parentheses. llvm/llvm-project#97323 changed the LLD version printout to no longer be enclosed in parentheses, which made Meson fail to detect the linker style used here. The LLD change is being reverted in llvm/llvm-project#97698 in order to fix building with existing Meson versions, but for the future, loosen the check slightly, to not require the parentheses.
0f9fbbb changed the version printouts. This broke linker detection in Meson, when disambiguating between the ld.lld and lld-link interfaces, in https://github.com/mesonbuild/meson/blob/1.4.1/mesonbuild/linkers/detect.py#L67, which checks for the string "(compatible with GNU linkers)" including the parentheses. Reinstate the parentheses in the printout here, for compatibility with Meson. The printout looks a little odd in this form, "LLD 19.0.0 (https://github.com/llvm/llvm-project 173514d) (compatible with GNU linkers)", but works with Meson. The Meson check should ideally be loosened. But even then, we should only change LLD to the new form once older versions of Meson aren't used for these targets any longer, i.e. earliest within a few years.
de9f9de
to
3f4cd57
Compare
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/141/builds/513 Here is the relevant piece of the build log for the reference:
|
…lvm#97698) 0f9fbbb changed the version printouts. This broke linker detection in Meson, when disambiguating between the ld.lld and lld-link interfaces, in https://github.com/mesonbuild/meson/blob/1.4.1/mesonbuild/linkers/detect.py#L67, which checks for the string "(compatible with GNU linkers)" including the parentheses. Reinstate the parentheses in the printout here, for compatibility with Meson. The printout looks a little odd in this form, "LLD 19.0.0 (https://github.com/llvm/llvm-project 173514d) (compatible with GNU linkers)", but works with Meson. The Meson check is loosened in mesonbuild/meson#13383, but existing versions of Meson with the too strict check will be around for quite some time, so we should only change LLD to the new form once older versions of Meson aren't used for these targets any longer, i.e. earliest within a few years.
Don't require the string to be enclosed in parentheses. llvm/llvm-project#97323 changed the LLD version printout to no longer be enclosed in parentheses, which made Meson fail to detect the linker style used here. The LLD change is being reverted in llvm/llvm-project#97698 in order to fix building with existing Meson versions, but for the future, loosen the check slightly, to not require the parentheses. (cherry picked from commit 1ca002a)
Don't require the string to be enclosed in parentheses. llvm/llvm-project#97323 changed the LLD version printout to no longer be enclosed in parentheses, which made Meson fail to detect the linker style used here. The LLD change is being reverted in llvm/llvm-project#97698 in order to fix building with existing Meson versions, but for the future, loosen the check slightly, to not require the parentheses.
0f9fbbb changed the version printouts. This broke linker detection in Meson, when disambiguating between the ld.lld and lld-link interfaces, in
https://github.com/mesonbuild/meson/blob/1.4.1/mesonbuild/linkers/detect.py#L67, which checks for the string "(compatible with GNU linkers)" including the parentheses.
Reinstate the parentheses in the printout here, for compatibility with Meson. The printout looks a little odd in this form, "LLD 19.0.0 (https://github.com/llvm/llvm-project 173514d) (compatible with GNU linkers)", but works with Meson.
The Meson check should ideally be loosened. But even then, we should only change LLD to the new form once older versions of Meson aren't used for these targets any longer, i.e. earliest within a few years.