git » libfiu » commit 8b7b0b3

Do not use the dummy backtrace on profiling builds

author Alberto Bertogli
2014-05-25 13:21:25 UTC
committer Alberto Bertogli
2014-05-25 23:45:10 UTC
parent 46bd609ef1f76655c560e8fae16b55c858da133d

Do not use the dummy backtrace on profiling builds

When building with PROFILE=1, the current USE_DUMMY_BACKTRACE test fails
because the compiler tries to write to /dev/null.gcno.

This patch fixes it by making it write to a local file instead, which we then
not use.

It also adds the profiling files to .gitignore while at it.

.gitignore +3 -0
libfiu/Makefile +2 -2

diff --git a/.gitignore b/.gitignore
index fa4df1a..5b38e06 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,3 +30,6 @@ tests/build-flags
 tests/test-?
 tests/generated/build-flags
 tests/generated/tests/*.[oc]
+.*.swp
+*.gcno
+*.gcda
diff --git a/libfiu/Makefile b/libfiu/Makefile
index 086a0b7..5981b64 100644
--- a/libfiu/Makefile
+++ b/libfiu/Makefile
@@ -43,7 +43,7 @@ LIB_SO_VER=0
 # attempting to compile it normally, and fall back to the dummy version if
 # that fails. Not very sophisticated but should be safe.
 USE_DUMMY_BACKTRACE := $(shell $(CC) $(ALL_CFLAGS) -c backtrace.c \
-	-o /dev/null 2>/dev/null || echo -DDUMMY_BACKTRACE)
+	-o backtrace-check.o || echo -DDUMMY_BACKTRACE)
 ifndef USE_DUMMY_BACKTRACE
 # The real backtrace needs linking against libdl.
 USE_LIBDL = -ldl
@@ -135,7 +135,7 @@ doxygen:
 
 
 clean:
-	rm -f libfiu.pc $(OBJS)
+	rm -f libfiu.pc $(OBJS) backtrace-check.o
 	rm -f libfiu.so libfiu.so.$(LIB_VER) libfiu.so.$(LIB_SO_VER) libfiu.a
 	rm -f *.bb *.bbg *.da *.gcov *.gcda *.gcno gmon.out build-flags
 	$(MAKE) -C doxygen $@