about summary refs log tree commit diff
path: root/elf/Makefile
diff options
context:
space:
mode:
authorStan Shebs <stanshebs@google.com>2018-06-01 14:57:50 -0700
committerFangrui Song <i@maskray.me>2021-08-27 16:22:14 -0700
commit4d4222dd27ca5be9d0d16ab180b98cc65cf7e5e3 (patch)
treeebecc6ed23efdad7c8f5c273c8f4642132f93d83 /elf/Makefile
parent121dc10a6d58a3488aa03233a8c3c9db067525aa (diff)
downloadglibc-4d4222dd27ca5be9d0d16ab180b98cc65cf7e5e3.tar.gz
glibc-4d4222dd27ca5be9d0d16ab180b98cc65cf7e5e3.tar.xz
glibc-4d4222dd27ca5be9d0d16ab180b98cc65cf7e5e3.zip
Work around a make 3.81 segfault with clang
Diffstat (limited to 'elf/Makefile')
-rw-r--r--elf/Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 7ce0925072..b9ea53932a 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -455,10 +455,12 @@ $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a
 	mv -f $@T $@
 
 # For lld, add to regexp below for optional address and size to be at front of line.
+# Also, Google b/79865038 reports that make 3.81 can segfault while iterating over
+# the repeated lib+file entries in the map; work around with sort -u .
 $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile
 	LC_ALL=C \
 	sed -n 's@^[0-9a-f ]*$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
-	    $< | \
+	    $< | LC_ALL=C sort -u | \
 	while read lib file; do \
 	  case $$lib in \
 	  libc_pic.a) \