[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.6-60-g33acfe7



The following commit has been merged in the master branch:
commit d08850e3c83a51398ab3c09246eaf206ec55b2f5
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Mar 18 11:17:04 2012 +0100

    t/tests/*: Enable hardening flags in builds
    
    Most of the tests in t/tests/binaries-* still emit the
    "hardening-no-stackprotector", but all of the "no-relro" has been
    fixed.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/t/tests/binaries-doesnt-match-sonames/debian/Makefile b/t/tests/binaries-doesnt-match-sonames/debian/Makefile
index 3deb0a2..f1e3a5a 100644
--- a/t/tests/binaries-doesnt-match-sonames/debian/Makefile
+++ b/t/tests/binaries-doesnt-match-sonames/debian/Makefile
@@ -1,5 +1,6 @@
 CC=gcc
-CFLAGS=-Wall -Winline -O2 -fPIC
+MYCFLAGS=-Wall -Winline -O2 -fPIC
+CFLAGS:=$(MYCFLAGS) $(CPPFLAGS) $(CFLAGS)
 
 SONAMES:= libany.so.1
 LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
@@ -7,7 +8,7 @@ LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
 all: $(LIBFILES)
 
 $(LIBFILES): code.o
-	$(CC) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
+	$(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
 
 clean:
 	rm -f *.a *.o *.so*
diff --git a/t/tests/binaries-doesnt-match-sonames/debian/code.c b/t/tests/binaries-doesnt-match-sonames/debian/code.c
index 0d033cd..0c4f917 100644
--- a/t/tests/binaries-doesnt-match-sonames/debian/code.c
+++ b/t/tests/binaries-doesnt-match-sonames/debian/code.c
@@ -1,2 +1,9 @@
-void e(void){
+#include <string.h>
+#include <stdio.h>
+
+void e(char *p, int i, void (*f)(char *)){
+  char test[10];
+  memcpy(test, p, i);
+  f(test);
+  printf("%s", test);
 }
diff --git a/t/tests/binaries-embedded-libs/debian/Makefile b/t/tests/binaries-embedded-libs/debian/Makefile
index b65a063..3068101 100644
--- a/t/tests/binaries-embedded-libs/debian/Makefile
+++ b/t/tests/binaries-embedded-libs/debian/Makefile
@@ -5,7 +5,7 @@ MANPAGES := $(patsubst %,%.1,$(BINARIES))
 all: $(BINARIES) $(MANPAGES)
 
 %: %.c
-	gcc -o $* $*.c
+	gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $* $*.c
 
 %.1: template.1
 	sed 's/#BIN#/$*/g' < $< > $@
diff --git a/t/tests/binaries-general/debian/Makefile b/t/tests/binaries-general/debian/Makefile
index 5858f0d..73446c0 100644
--- a/t/tests/binaries-general/debian/Makefile
+++ b/t/tests/binaries-general/debian/Makefile
@@ -1,13 +1,15 @@
+COMPILE:= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
+
 all:
 	# rpath not matching any of the exceptions to the rpath checks
 	#  - with profiling enabled.
-	gcc -o basic basic.c -pg -Wl,--rpath,/usr/local/lib
+	$(COMPILE) -o basic basic.c -pg -Wl,--rpath,/usr/local/lib
 	# rpath shipped in the package, but one of {/usr}?/lib
-	gcc -o basiclibrpath basic.c -Wl,--rpath,/usr/lib
+	$(COMPILE) -o basiclibrpath basic.c -Wl,--rpath,/usr/lib
 	# non-special rpath shipped in the package
-	gcc -o basicshippedrpath basic.c -Wl,--rpath,/usr/share/foo
+	$(COMPILE) -o basicshippedrpath basic.c -Wl,--rpath,/usr/share/foo
 	# static version of basic for debugging checks
-	gcc -static -o basic.static basic.c
+	$(COMPILE) -static -o basic.static basic.c
 
 install:
 	install -d $(DESTDIR)/usr/share/foo/
diff --git a/t/tests/binaries-general/debian/basic.c b/t/tests/binaries-general/debian/basic.c
index 00f3787..7dea5a0 100644
--- a/t/tests/binaries-general/debian/basic.c
+++ b/t/tests/binaries-general/debian/basic.c
@@ -3,5 +3,10 @@
 int
 main(void)
 {
+    char t[10];
     printf("Hello world!\n");
+    /* Bad choice for reading from stdin, but it forces a stack
+       protector, so meh.
+     */
+    gets (t);
 }
diff --git a/t/tests/binaries-missing-depends-on-libc/debian/Makefile b/t/tests/binaries-missing-depends-on-libc/debian/Makefile
index ed44e4a..6fc3968 100644
--- a/t/tests/binaries-missing-depends-on-libc/debian/Makefile
+++ b/t/tests/binaries-missing-depends-on-libc/debian/Makefile
@@ -1,5 +1,5 @@
 all:
-	gcc -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c
+	gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c
 
 install:
 	# install it under the correct triplet directory
diff --git a/t/tests/binaries-missing-depends-on-xapi/debian/Makefile b/t/tests/binaries-missing-depends-on-xapi/debian/Makefile
index cb7b2c4..14a6e28 100644
--- a/t/tests/binaries-missing-depends-on-xapi/debian/Makefile
+++ b/t/tests/binaries-missing-depends-on-xapi/debian/Makefile
@@ -1,5 +1,5 @@
 all:
-	gcc -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so basic.c
+	gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so basic.c
 
 install:
 	# install it under the correct triplet directory
diff --git a/t/tests/binaries-missing-depends/debian/Makefile b/t/tests/binaries-missing-depends/debian/Makefile
index ed44e4a..6fc3968 100644
--- a/t/tests/binaries-missing-depends/debian/Makefile
+++ b/t/tests/binaries-missing-depends/debian/Makefile
@@ -1,5 +1,5 @@
 all:
-	gcc -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c
+	gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c
 
 install:
 	# install it under the correct triplet directory
diff --git a/t/tests/binaries-multiarch-same/debian/Makefile b/t/tests/binaries-multiarch-same/debian/Makefile
index 889f388..ad7783b 100644
--- a/t/tests/binaries-multiarch-same/debian/Makefile
+++ b/t/tests/binaries-multiarch-same/debian/Makefile
@@ -1,6 +1,6 @@
 
 all:
-	gcc -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c
+	gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c
 
 install:
 	install -d $(DESTDIR)/usr/lib/
diff --git a/t/tests/binaries-multiarch-wrong-dir/debian/Makefile b/t/tests/binaries-multiarch-wrong-dir/debian/Makefile
index 77c552c..58cac33 100644
--- a/t/tests/binaries-multiarch-wrong-dir/debian/Makefile
+++ b/t/tests/binaries-multiarch-wrong-dir/debian/Makefile
@@ -13,7 +13,7 @@ endif
 
 
 all:
-	gcc -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c
+	gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c
 
 install:
 	# Install it once under the wrong dir
diff --git a/t/tests/binaries-multiarch/debian/Makefile b/t/tests/binaries-multiarch/debian/Makefile
index 9826b20..979e366 100644
--- a/t/tests/binaries-multiarch/debian/Makefile
+++ b/t/tests/binaries-multiarch/debian/Makefile
@@ -13,7 +13,7 @@ endif
 
 
 all:
-	gcc -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c
+	gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c
 
 install:
 	# install it under the correct triplet directory
diff --git a/t/tests/binaries-spelling/debian/Makefile b/t/tests/binaries-spelling/debian/Makefile
index ee78503..0c85616 100644
--- a/t/tests/binaries-spelling/debian/Makefile
+++ b/t/tests/binaries-spelling/debian/Makefile
@@ -1,5 +1,5 @@
 all:
-	gcc -o basic basic.c
+	gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o basic basic.c
 
 install:
 	install -d $(DESTDIR)/usr/bin
diff --git a/t/tests/binaries-unsafe-open/debian/Makefile b/t/tests/binaries-unsafe-open/debian/Makefile
index f06dce3..19b3aed 100644
--- a/t/tests/binaries-unsafe-open/debian/Makefile
+++ b/t/tests/binaries-unsafe-open/debian/Makefile
@@ -1,5 +1,5 @@
 all:
-	gcc -o dummy dummy.c
+	gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o dummy dummy.c
 
 install:
 	install -d $(DESTDIR)/usr/bin
diff --git a/t/tests/files-multiarch-missing-pre-deps/debian/Makefile b/t/tests/files-multiarch-missing-pre-deps/debian/Makefile
index 9826b20..979e366 100644
--- a/t/tests/files-multiarch-missing-pre-deps/debian/Makefile
+++ b/t/tests/files-multiarch-missing-pre-deps/debian/Makefile
@@ -13,7 +13,7 @@ endif
 
 
 all:
-	gcc -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c
+	gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c
 
 install:
 	# install it under the correct triplet directory
diff --git a/t/tests/files-multiarch-missing-pre-deps/debian/basic.c b/t/tests/files-multiarch-missing-pre-deps/debian/basic.c
index a03a790..b7fee65 100644
--- a/t/tests/files-multiarch-missing-pre-deps/debian/basic.c
+++ b/t/tests/files-multiarch-missing-pre-deps/debian/basic.c
@@ -1,7 +1,12 @@
 #include <stdio.h>
 
 int
-lib_interface(void)
+lib_interface(int (*a)(char *))
 {
-    printf("Hello world!\n");
+    char tmp[10];
+    int r = a(tmp);
+    if (r < 0) {
+      fprintf(stderr, "%s\n", tmp);
+    }
+    return r;
 }
diff --git a/t/tests/files-python-general/debian/Makefile b/t/tests/files-python-general/debian/Makefile
index e0b4b27..e246faf 100644
--- a/t/tests/files-python-general/debian/Makefile
+++ b/t/tests/files-python-general/debian/Makefile
@@ -1,7 +1,7 @@
 all: lib.c
 	echo 'Hallo World' > code.pyc
 	echo 'Hallo World' > code.pyo
-	gcc -g -O2 -shared -o python-module.so lib.c
+	gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -o python-module.so lib.c
 
 distclean:
 	rm -f code.pyc code.pyo python-module.so
diff --git a/t/tests/files-python-general/debian/debian/control.in b/t/tests/files-python-general/debian/debian/control.in
index 8513ca9..fa1e440 100644
--- a/t/tests/files-python-general/debian/debian/control.in
+++ b/t/tests/files-python-general/debian/debian/control.in
@@ -3,7 +3,7 @@ Priority: extra
 Section: python
 Maintainer: {$author}
 Standards-Version: {$standards_version}
-Build-Depends: debhelper (>= 7.0.50~)
+Build-Depends: debhelper (>= 7.0.50~), dpkg-dev (>= 1.16.1~)
 
 Package: python-kinterbasdb
 Architecture: any
diff --git a/t/tests/files-python-general/debian/debian/rules b/t/tests/files-python-general/debian/debian/rules
index 4832b31..3bf6404 100644
--- a/t/tests/files-python-general/debian/debian/rules
+++ b/t/tests/files-python-general/debian/debian/rules
@@ -1,5 +1,8 @@
 #!/usr/bin/make -f
 
+DPKG_EXPORT_BUILDFLAGS:=1
+include /usr/share/dpkg/buildflags.mk
+
 DOCS:=debian/python-kinterbasdb/usr/share/doc/python-kinterbasdb/docs
 %:
 	dh $@
diff --git a/t/tests/files-python-general/debian/lib.c b/t/tests/files-python-general/debian/lib.c
index fd91682..30d6ed5 100644
--- a/t/tests/files-python-general/debian/lib.c
+++ b/t/tests/files-python-general/debian/lib.c
@@ -1,3 +1,4 @@
-int do_something(int a){
-  return a * a;
+int do_something(int (*a)(char *)){
+  char test[10];
+  return a(test);
 }
diff --git a/t/tests/shared-libs-control-file/debian/Makefile b/t/tests/shared-libs-control-file/debian/Makefile
index e76a235..37bef22 100644
--- a/t/tests/shared-libs-control-file/debian/Makefile
+++ b/t/tests/shared-libs-control-file/debian/Makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-Wall -Winline -O2 -fPIC
+CFLAGS+= -fPIC
 
 SONAMES:= libnoshf.so.1 libeshf.so.1 libunshf.so.1 libfdshf.so.1 \
 	  libdupshf.so.1
@@ -8,7 +8,7 @@ LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
 all: $(LIBFILES)
 
 $(LIBFILES): code.o
-	$(CC) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
+	$(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
 
 clean:
 	rm -f *.a *.o *.so*
diff --git a/t/tests/shared-libs-control-file/debian/code.c b/t/tests/shared-libs-control-file/debian/code.c
index 1eb449e..0ed08e0 100644
--- a/t/tests/shared-libs-control-file/debian/code.c
+++ b/t/tests/shared-libs-control-file/debian/code.c
@@ -1,6 +1,11 @@
+#include <stdlib.h>
 #include <math.h>
 
-double e(double x){
+double e(void (*f)(char *)){
+  char tmp[10];
+  double x;
+  f(tmp);
+  x = atof(tmp);
   return exp(x);
 }
 
diff --git a/t/tests/shared-libs-exec-bit/debian/Makefile b/t/tests/shared-libs-exec-bit/debian/Makefile
index 02a3474..68d5863 100644
--- a/t/tests/shared-libs-exec-bit/debian/Makefile
+++ b/t/tests/shared-libs-exec-bit/debian/Makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-Wall -Winline -O2 -fPIC
+CFLAGS+= -fPIC
 
 SONAMES:= libexecbit.so.1
 LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
@@ -7,7 +7,7 @@ LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
 all: $(LIBFILES)
 
 $(LIBFILES): code.o
-	$(CC) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
+	$(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
 
 clean:
 	rm -f *.a *.o *.so*
diff --git a/t/tests/shared-libs-exec-bit/debian/code.c b/t/tests/shared-libs-exec-bit/debian/code.c
index 1eb449e..0ed08e0 100644
--- a/t/tests/shared-libs-exec-bit/debian/code.c
+++ b/t/tests/shared-libs-exec-bit/debian/code.c
@@ -1,6 +1,11 @@
+#include <stdlib.h>
 #include <math.h>
 
-double e(double x){
+double e(void (*f)(char *)){
+  char tmp[10];
+  double x;
+  f(tmp);
+  x = atof(tmp);
   return exp(x);
 }
 
diff --git a/t/tests/shared-libs-exit-fork/debian/Makefile b/t/tests/shared-libs-exit-fork/debian/Makefile
index 02a3474..68d5863 100644
--- a/t/tests/shared-libs-exit-fork/debian/Makefile
+++ b/t/tests/shared-libs-exit-fork/debian/Makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-Wall -Winline -O2 -fPIC
+CFLAGS+= -fPIC
 
 SONAMES:= libexecbit.so.1
 LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
@@ -7,7 +7,7 @@ LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
 all: $(LIBFILES)
 
 $(LIBFILES): code.o
-	$(CC) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
+	$(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
 
 clean:
 	rm -f *.a *.o *.so*
diff --git a/t/tests/shared-libs-exit-fork/debian/code.c b/t/tests/shared-libs-exit-fork/debian/code.c
index f593473..df63394 100644
--- a/t/tests/shared-libs-exit-fork/debian/code.c
+++ b/t/tests/shared-libs-exit-fork/debian/code.c
@@ -1,7 +1,12 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-void e(void){
+double e(void (*f)(char *)){
+  char tmp[10];
+  double x;
+  f(tmp);
+  x = atof(tmp);
   if (fork() != 0)
     exit(1);
+  return x;
 }
diff --git a/t/tests/shared-libs-exit/debian/Makefile b/t/tests/shared-libs-exit/debian/Makefile
index 02a3474..68d5863 100644
--- a/t/tests/shared-libs-exit/debian/Makefile
+++ b/t/tests/shared-libs-exit/debian/Makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-Wall -Winline -O2 -fPIC
+CFLAGS+= -fPIC
 
 SONAMES:= libexecbit.so.1
 LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
@@ -7,7 +7,7 @@ LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
 all: $(LIBFILES)
 
 $(LIBFILES): code.o
-	$(CC) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
+	$(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
 
 clean:
 	rm -f *.a *.o *.so*
diff --git a/t/tests/shared-libs-exit/debian/code.c b/t/tests/shared-libs-exit/debian/code.c
index 1ea8589..297a4e8 100644
--- a/t/tests/shared-libs-exit/debian/code.c
+++ b/t/tests/shared-libs-exit/debian/code.c
@@ -1,5 +1,13 @@
 #include <stdlib.h>
 
-void e(void){
-  exit(1);
+double e(void (*f)(char *)){
+  char tmp[10];
+  double x;
+  f(tmp);
+  x = atof(tmp);
+  if (x < 0.0) {
+    exit(1);
+  } else {
+    return x;
+  }
 }
diff --git a/t/tests/shared-libs-ldconfig-scripts/debian/Makefile b/t/tests/shared-libs-ldconfig-scripts/debian/Makefile
index 5794504..4d3c286 100644
--- a/t/tests/shared-libs-ldconfig-scripts/debian/Makefile
+++ b/t/tests/shared-libs-ldconfig-scripts/debian/Makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-Wall -Winline -O2 -fPIC
+CFLAGS+= -fPIC
 
 SONAMES:= libfoo.so.1 libfish.so.1 libuns.so.1
 LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
@@ -7,7 +7,7 @@ LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
 all: $(LIBFILES)
 
 $(LIBFILES): code.o
-	$(CC) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lm
+	$(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lm
 
 clean:
 	rm -f *.a *.o *.so*
diff --git a/t/tests/shared-libs-ldconfig-scripts/debian/code.c b/t/tests/shared-libs-ldconfig-scripts/debian/code.c
index 1eb449e..0ed08e0 100644
--- a/t/tests/shared-libs-ldconfig-scripts/debian/code.c
+++ b/t/tests/shared-libs-ldconfig-scripts/debian/code.c
@@ -1,6 +1,11 @@
+#include <stdlib.h>
 #include <math.h>
 
-double e(double x){
+double e(void (*f)(char *)){
+  char tmp[10];
+  double x;
+  f(tmp);
+  x = atof(tmp);
   return exp(x);
 }
 
diff --git a/t/tests/shared-libs-missing-ldconfig-symlink/debian/Makefile b/t/tests/shared-libs-missing-ldconfig-symlink/debian/Makefile
index 7596292..6de6868 100644
--- a/t/tests/shared-libs-missing-ldconfig-symlink/debian/Makefile
+++ b/t/tests/shared-libs-missing-ldconfig-symlink/debian/Makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-Wall -Winline -O2 -fPIC
+CFLAGS+= -fPIC
 
 SONAMES:= libexecbit.so.1
 LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
@@ -7,7 +7,7 @@ LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
 all: $(LIBFILES)
 
 $(LIBFILES): code.o
-	$(CC) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
+	$(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
 
 clean:
 	rm -f *.a *.o *.so*
diff --git a/t/tests/shared-libs-missing-ldconfig-symlink/debian/code.c b/t/tests/shared-libs-missing-ldconfig-symlink/debian/code.c
index f593473..65887f3 100644
--- a/t/tests/shared-libs-missing-ldconfig-symlink/debian/code.c
+++ b/t/tests/shared-libs-missing-ldconfig-symlink/debian/code.c
@@ -1,7 +1,10 @@
 #include <stdlib.h>
-#include <unistd.h>
+#include <math.h>
 
-void e(void){
-  if (fork() != 0)
-    exit(1);
+double e(void (*f)(char *)){
+  char tmp[10];
+  double x;
+  f(tmp);
+  x = atof(tmp);
+  return exp(x);
 }
diff --git a/t/tests/shared-libs-multi-arch-foreign/debian/Makefile b/t/tests/shared-libs-multi-arch-foreign/debian/Makefile
index f2157b6..ac55af7 100644
--- a/t/tests/shared-libs-multi-arch-foreign/debian/Makefile
+++ b/t/tests/shared-libs-multi-arch-foreign/debian/Makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-Wall -Winline -O2 -fPIC
+CFLAGS+= -fPIC
 
 SONAMES:= libhallo.so.1
 LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
@@ -7,7 +7,7 @@ LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
 all: $(LIBFILES)
 
 $(LIBFILES): code.o
-	$(CC) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
+	$(CC) $(LDFLAGS) -fPIC -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
 
 clean:
 	rm -f *.a *.o *.so*
diff --git a/t/tests/shared-libs-multi-arch-foreign/debian/code.c b/t/tests/shared-libs-multi-arch-foreign/debian/code.c
index ae5d71a..65887f3 100644
--- a/t/tests/shared-libs-multi-arch-foreign/debian/code.c
+++ b/t/tests/shared-libs-multi-arch-foreign/debian/code.c
@@ -1,5 +1,10 @@
-#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
 
-void e(void){
-  printf("Hallo World!\n");
+double e(void (*f)(char *)){
+  char tmp[10];
+  double x;
+  f(tmp);
+  x = atof(tmp);
+  return exp(x);
 }
diff --git a/t/tests/shared-libs-non-pic-i386/debian/Makefile b/t/tests/shared-libs-non-pic-i386/debian/Makefile
index 8b68d39..a62fdd7 100644
--- a/t/tests/shared-libs-non-pic-i386/debian/Makefile
+++ b/t/tests/shared-libs-non-pic-i386/debian/Makefile
@@ -1,5 +1,4 @@
 CC=gcc
-CFLAGS=-Wall -Winline -O2
 
 NOPICOBJS=non-pic.o
 SONAME:=libbaz3.so.1
@@ -8,10 +7,10 @@ all: libbaz3.so.1.0.3b
 
 # Non-PIC. We can't test this on all architectures
 libbaz3.so.1.0.3b: $(NOPICOBJS)
-	$(CC) -o $@ -shared -Wl,-soname,$(SONAME) $^ -lc
+	$(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(SONAME) $^ -lc
 
 %.o: %.c
-	$(CC) $(CFLAGS) -o $@ -c $<
+	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
 
 clean:
 	rm -f *.a *.o *.so* *.sho
diff --git a/t/tests/shared-libs-symbols-file/upstream/Makefile b/t/tests/shared-libs-symbols-file/upstream/Makefile
index ab3b59b..5ab4ec1 100644
--- a/t/tests/shared-libs-symbols-file/upstream/Makefile
+++ b/t/tests/shared-libs-symbols-file/upstream/Makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-Wall -Winline -O2 -fPIC
+CFLAGS+= -fPIC
 
 SONAMES:= libfoo.so.1 libsym.so.1 libesym.so.1
 LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
@@ -7,7 +7,7 @@ LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
 all: $(LIBFILES)
 
 $(LIBFILES): code.o
-	$(CC) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
+	$(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc
 
 clean:
 	rm -f *.a *.o *.so*
diff --git a/t/tests/shared-libs-symbols-file/upstream/code.c b/t/tests/shared-libs-symbols-file/upstream/code.c
index 1eb449e..0ed08e0 100644
--- a/t/tests/shared-libs-symbols-file/upstream/code.c
+++ b/t/tests/shared-libs-symbols-file/upstream/code.c
@@ -1,6 +1,11 @@
+#include <stdlib.h>
 #include <math.h>
 
-double e(double x){
+double e(void (*f)(char *)){
+  char tmp[10];
+  double x;
+  f(tmp);
+  x = atof(tmp);
   return exp(x);
 }
 
diff --git a/t/tests/shared-libs-unversioned/debian/Makefile b/t/tests/shared-libs-unversioned/debian/Makefile
index 8b1da19..daf74d1 100644
--- a/t/tests/shared-libs-unversioned/debian/Makefile
+++ b/t/tests/shared-libs-unversioned/debian/Makefile
@@ -1,13 +1,12 @@
 CC = gcc
-CFLAGS = -Wall -O2
 
 all: libfoo.so
 
 libfoo.so: foo.o
-	$(CC) -o $@ -shared -Wl,-soname,libfoo.so $^ -lc
+	$(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libfoo.so $^ -lc
 
 %.o: %.c
-	$(CC) $(CFLAGS) -fPIC -o $@ -c $<
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -o $@ -c $<
 
 install:
 	install -d $(DESTDIR)/usr/lib
diff --git a/t/tests/shared-libs-unversioned/debian/foo.c b/t/tests/shared-libs-unversioned/debian/foo.c
index d5dd1be..aa323d5 100644
--- a/t/tests/shared-libs-unversioned/debian/foo.c
+++ b/t/tests/shared-libs-unversioned/debian/foo.c
@@ -5,6 +5,16 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+double e(void (*f)(char *)){
+  char tmp[10];
+  double x;
+  f(tmp);
+  x = atof(tmp);
+  return exp(x);
+}
 
 int
 foo(int num)

-- 
Debian package checker


Reply to: