Skip to content

Commit

Permalink
Strip -Wl for static-testinstall and shared-testinstall as well.
Browse files Browse the repository at this point in the history
Fixes #443.

Change-Id: Id5534e4ec24a366ea375c4d9505ab3fb6ebbb953
Reviewed-on: https://code-review.googlesource.com/c/re2/+/61750
Reviewed-by: Alex Chernyakhovsky <[email protected]>
Reviewed-by: Paul Wankadia <[email protected]>
  • Loading branch information
junyer committed Aug 29, 2023
1 parent 73031bb commit 523f9b0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 523f9b0

Please sign in to comment.