I have found the lookup by build-id (when lookup by /usr/lib/debug/path/name/exec.debug failed) does not work as LLDB tries the build-id hex string in uppercase but Fedora uses lowercase. xubuntu-16.10 also uses lowercase during my test: /usr/lib/debug/.build-id/6c/61f3566329f43d03f812ae7057e9e7391b5ff6.debug Differential revision: https://reviews.llvm.org/D42852 llvm-svn: 324222
21 lines
538 B
Makefile
21 lines
538 B
Makefile
LEVEL = ../../make
|
|
C_SOURCES := main.c
|
|
LD_EXTRAS += -Wl,--build-id=sha1
|
|
|
|
all: stripped.out
|
|
|
|
.PHONY: .build-id
|
|
stripped.out .build-id: a.out
|
|
$(OBJCOPY) -j .note.gnu.build-id -O binary $< tmp
|
|
rm -rf .build-id
|
|
fn=`od -An -tx1 <tmp|tr -d ' \n'|sed -e 's/^.\{32\}//' -e 's#^..#.build-id/&/#' -e 's#$$#.debug#'` && \
|
|
mkdir -p `dirname $$fn` && \
|
|
$(OBJCOPY) --only-keep-debug $< $$fn && \
|
|
$(OBJCOPY) --strip-all --add-gnu-debuglink=$$fn $< stripped.out
|
|
$(RM) tmp
|
|
|
|
clean::
|
|
$(RM) -r stripped.out .build-id
|
|
|
|
include $(LEVEL)/Makefile.rules
|