mirror of
https://git.sr.ht/~nabijaczleweli/tzpfms
synced 2025-04-13 09:37:13 +03:00
Pass --as-needed to ld instead of doing ldd/patchelf crimes
This commit is contained in:
parent
0b634d9f2d
commit
d0cef4c7f6
@ -3,7 +3,6 @@ packages:
|
||||
- clang
|
||||
- pkg-config
|
||||
- libtss2-dev
|
||||
- patchelf
|
||||
- ronn
|
||||
tasks:
|
||||
- get-zfs: |
|
||||
|
3
Makefile
3
Makefile
@ -63,9 +63,8 @@ $(subst $(MANDIR),$(OUTDIR)man/,$(MANPAGE_SOURCES)) : $(MANDIR)index.txt $(MANPA
|
||||
|
||||
$(OUTDIR)%$(EXE) : $(subst $(SRCDIR),$(OBJDIR),$(subst .cpp,$(OBJ),$(SRCDIR)bin/%.cpp $(COMMON_SOURCES)))
|
||||
@mkdir -p $(dir $@)
|
||||
$(CXX) $(CXXAR) -o$@ $^ $(PIC) $(LDAR)
|
||||
$(CXX) $(CXXAR) -o$@ $^ $(PIC) -Wl,--as-needed $(LDAR)
|
||||
$(STRIP) $(STRIPAR) $@
|
||||
$(LDD) --unused $@ | $(AWK) -F/ 'BEGIN {args = ""} /^\t/ {args = args " --remove-needed " $$NF} END { if(!args) exit; print "$(PATCHELF)" args " $@"}' | sh -x
|
||||
|
||||
$(OBJDIR)%$(OBJ) : $(SRCDIR)%.cpp
|
||||
@mkdir -p $(dir $@)
|
||||
|
@ -14,7 +14,7 @@ Plus it's a pretty good annoyed sigh onomatopoeia.
|
||||
|
||||
### Building
|
||||
|
||||
You'll need `pkg-config`, `patchelf` (or to set `$PATCHELF=true`), `libzfslinux-dev`, `libtss2-dev`<!-- , to initialise the submodules -->, and `make` should hopefully Just Work™ if you have a C++17-capable compiler.
|
||||
You'll need `pkg-config`, `libzfslinux-dev`, `libtss2-dev`<!-- , to initialise the submodules -->, and `make` should hopefully Just Work™ if you have a C++17-capable compiler.
|
||||
The output binaries are trimmed of extraneous dependencies, so they're all just libc + libzfs and friends + TPM back-end.
|
||||
|
||||
### Installation
|
||||
|
@ -55,7 +55,6 @@ LNCMAKEAR := LDFLAGS="$(LNCXXAR)"
|
||||
LDD ?= ldd
|
||||
AWK ?= awk
|
||||
RONN ?= ronn
|
||||
PATCHELF ?= patchelf
|
||||
OBJ := .o
|
||||
CXXAR := -g -O3 -std=c++17 -fno-exceptions -Wall -Wextra $(CXXSPECIFIC) -pipe $(INCCXXAR) $(PIC)
|
||||
STRIP ?= @echo strip
|
||||
|
Loading…
x
Reference in New Issue
Block a user