From 523f9b097163895957f0fdd91cb8aa595c7f65a1 Mon Sep 17 00:00:00 2001 From: Paul Wankadia Date: Tue, 29 Aug 2023 12:08:07 +0000 Subject: [PATCH] Strip `-Wl` for `static-testinstall` and `shared-testinstall` as well. Fixes #443. Change-Id: Id5534e4ec24a366ea375c4d9505ab3fb6ebbb953 Reviewed-on: https://code-review.googlesource.com/c/re2/+/61750 Reviewed-by: Alex Chernyakhovsky Reviewed-by: Paul Wankadia --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1f61424d7..60b79c981 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,7 @@ ABSL_DEPS=\ CCABSL=$(shell pkg-config $(ABSL_DEPS) --cflags) # GCC barfs on `-Wl` whereas Clang doesn't mind, but it's unclear what # causes it to manifest on Ubuntu 22.04 LTS, so filter it out for now. +# Similar is needed for `static-testinstall` and `shared-testinstall`. LDABSL=$(shell pkg-config $(ABSL_DEPS) --libs | sed -e 's/-Wl / /g') # To build against ICU for full Unicode properties support, @@ -358,7 +359,8 @@ else @cp testinstall.cc obj/static-testinstall.cc (cd obj && export PKG_CONFIG_PATH=$(DESTDIR)$(libdir)/pkgconfig; \ $(CXX) static-testinstall.cc -o static-testinstall $(CXXFLAGS) $(LDFLAGS) \ - $$(pkg-config re2 --cflags --libs | sed -e 's/-lre2/-l:libre2.a/')) + $$(pkg-config re2 --cflags) \ + $$(pkg-config re2 --libs | sed -e 's/-Wl / /g' | sed -e 's/-lre2/-l:libre2.a/')) obj/static-testinstall endif @@ -368,7 +370,8 @@ shared-testinstall: @cp testinstall.cc obj/shared-testinstall.cc (cd obj && export PKG_CONFIG_PATH=$(DESTDIR)$(libdir)/pkgconfig; \ $(CXX) shared-testinstall.cc -o shared-testinstall $(CXXFLAGS) $(LDFLAGS) \ - $$(pkg-config re2 --cflags --libs)) + $$(pkg-config re2 --cflags) \ + $$(pkg-config re2 --libs | sed -e 's/-Wl / /g')) ifeq ($(shell uname),Darwin) DYLD_LIBRARY_PATH="$(DESTDIR)$(libdir):$(DYLD_LIBRARY_PATH)" obj/shared-testinstall else