Skip to content
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

Makefile.common: fix ld version parsing #216

Merged
merged 1 commit into from
Oct 23, 2024
Merged
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
6 changes: 4 additions & 2 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ endif

# Do not warn about RWX segments.
# binutils >= 2.39 required
LD_VERSION_MINOR := $(shell $(LD) $(LDFLAGS_PREFIX)--version 2> /dev/null | grep -Eo "[0-9][0-9]$$")
ifeq ($(shell expr $(LD_VERSION_MINOR) ">=" 39), 1)
LD_VERSION_MINOR := $(shell $(LD) $(LDFLAGS_PREFIX)--version 2> /dev/null | grep -Eo "\b2\.[0-9]*" | cut -d . -f 2)
ifeq ($(LD_VERSION_MINOR),)
$(error Can't parse LD version!)
else ifeq ($(shell expr $(LD_VERSION_MINOR) ">=" 39), 1)
LDFLAGS += $(LDFLAGS_PREFIX)--no-warn-rwx-segments
endif

Expand Down
Loading