[git commit] buildsys: link libgcc_eh if DODEBUG

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Wed Jan 16 12:36:40 UTC 2013


commit: http://git.uclibc.org/uClibc/commit/?id=8d31a6e50db423b89082b64a3250eec1b94a7456
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

with -O0 we (e.g. lockf) might end up with references to
_Unwind_Resume, so pull in gcc_eh in this case..

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 Rules.mak              |    4 ++++
 libc/misc/file/lockf.c |    5 +----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Rules.mak b/Rules.mak
index 8943fbf..9d621b5 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -804,6 +804,10 @@ ASFLAGS = $(ASFLAG_--noexecstack)
 
 LIBGCC_CFLAGS ?= $(CFLAGS) $(CPU_CFLAGS-y)
 $(eval $(call cache-output-var,LIBGCC,$(CC) $(LIBGCC_CFLAGS) -print-libgcc-file-name))
+$(eval $(call cache-output-var,LIBGCC_EH,$(CC) $(LIBGCC_CFLAGS) -print-file-name=libgcc_eh.a))
+# with -O0 we (e.g. lockf) might end up with references to
+# _Unwind_Resume, so pull in gcc_eh in this case..
+LIBGCC += $(if $(DODEBUG),$(LIBGCC_EH))
 LIBGCC_DIR:=$(dir $(LIBGCC))
 
 # moved from libpthread/linuxthreads
diff --git a/libc/misc/file/lockf.c b/libc/misc/file/lockf.c
index 4e398cd..56b3aac 100644
--- a/libc/misc/file/lockf.c
+++ b/libc/misc/file/lockf.c
@@ -16,15 +16,12 @@
    see <http://www.gnu.org/licenses/>.  */
 
 #include <features.h>
-
 #include <sys/types.h>
-#include <unistd.h>
 #include <fcntl.h>
+#include <unistd.h>
 #include <errno.h>
 #include <string.h>
 
-
-
 /* lockf is a simplified interface to fcntl's locking facilities.  */
 
 int lockf (int fd, int cmd, off_t len)


More information about the uClibc-cvs mailing list