Package: stud Version: 0.3-3 Severity: wishlist User: [email protected] Usertags: ld-as-needed Tags: patch
stud fails to build with ld --as-needed. With --as-needed libraries need to be placed before objects needing their symbols. Attached patch fixes the issue.
Description: fix FTBFS binutils with ld as-needed libraries must be placed behind objects needing them Author: Mahyuddin Susanto <[email protected]> Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/stud/+bug/913640 --- a/Makefile +++ b/Makefile @@ -8,7 +8,8 @@ BINDIR = $(PREFIX)/bin MANDIR = $(PREFIX)/share/man CFLAGS = $(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get CFLAGS) -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE -LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) -lssl -lcrypto -lev +LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) +LIBS = -lssl -lcrypto -lev OBJS = stud.o ringbuffer.o all: realall @@ -46,7 +47,7 @@ ALL += stud realall: $(ALL) stud: $(OBJS) - $(CC) $(LDFLAGS) -o $@ $^ + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) install: $(ALL) install -d $(DESTDIR)$(BINDIR) --- a/ebtree/Makefile +++ b/ebtree/Makefile @@ -1,6 +1,7 @@ OBJS = ebtree.o eb32tree.o eb64tree.o ebmbtree.o ebsttree.o ebimtree.o ebistree.o CFLAGS = -O3 EXAMPLES = $(basename $(wildcard examples/*.c)) +LIBS = -lssl -lcrypto -lev all: libebtree.a @@ -10,15 +11,15 @@ libebtree.a: $(OBJS) $(AR) rv $@ $^ %.o: %.c - $(CC) $(CFLAGS) -o $@ -c $^ + $(CC) $(CFLAGS) -o $@ -c $^ $(LIBS) examples/%: examples/%.c libebtree.a - $(CC) $(CFLAGS) -I. -o $@ $< -L. -lebtree + $(CC) $(CFLAGS) -I. -o $@ $< -L. -lebtree $(LIBS) test: test32 test64 testst test%: test%.c libebtree.a - $(CC) $(CFLAGS) -o $@ $< -L. -lebtree + $(CC) $(CFLAGS) -o $@ $< -L. -lebtree $(LIBS) clean: -rm -fv libebtree.a $(OBJS) *~ *.rej core test32 test64 testst ${EXAMPLES}

