This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 2/3] Define libgcc soname in make scripts and not in aheader
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 6 Apr 2012 19:14:22 +0530
- Subject: [PATCH 2/3] Define libgcc soname in make scripts and not in aheader
Hi,
Currently the libgcc soname is defined in a header file
sysdeps/generic/libgcc_s.h. This is not available to any non-code
components and hence needs to be moved to the make scripts to make it
more widely available. This patch does just that.
This really only requires a build test since I have only moved the
definition of a macro, so I have done that for x86. I had access to an
s390x box that passes the build successfully as far as my changes are
concerned and then fails on an unrelated error in a different place
(Unknown pseudo-op: `.machine'). So I'd like it if further confirmation
is done for s390 by someone who has access to a system that they
regularly use for builds.
Regards,
Siddhesh
ChangeLog:
2012-04-06 Siddhesh Poyarekar <siddhesh@redhat.com>
* Makeconfig (libgcc-so-name): Define libgcc soname.
* sysdeps/generic/Makefile: Use it.
* sysdeps/generic/libgcc_s.h: Remove.
* sysdeps/generic/framestate.c: Don't include libgcc_s.h.
* sysdeps/gnu/unwind-resume.c: Likewise.
* sysdeps/generic/Makefile: Add libgcc-so-name to CFLAGS for
framestate.c.
* sysdeps/unix/sysv/linux/s390/s390-32/Makefile: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/Makefile: Likewise.
* sysdeps/gnu/Makefile: Likewise for rt-unwind-resume.c and
unwind-resume.c.
nptl/ChangeLog:
2012-04-06 Siddhesh Poyarekar <siddhesh@redhat.com>
* sysdeps/pthread/unwind-forcedunwind.c: Don't include
libgcc_s.h.
* sysdeps/pthread/Makefile: Add libgcc-so-name to CFLAGS for
unwind-forcedunwind.c.
diff --git a/Makeconfig b/Makeconfig
index 4fc1141..7a46d44 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -110,6 +110,8 @@ ifdef objdir
+sysdep_dirs := $(objdir) $(+sysdep_dirs)
endif
+libgcc-so-name = libgcc_s.so.1
+
# Run config.status to update config.make and config.h. We don't show the
# dependence of config.h to Make, because it is only touched when it
# changes and so config.status would be run every time; the dependence of
diff --git a/nptl/sysdeps/pthread/Makefile b/nptl/sysdeps/pthread/Makefile
index a17e1e6..ff1a55b 100644
--- a/nptl/sysdeps/pthread/Makefile
+++ b/nptl/sysdeps/pthread/Makefile
@@ -18,6 +18,7 @@
ifeq ($(subdir),nptl)
libpthread-sysdep_routines += errno-loc
+CFLAGS-unwind-forcedunwind.c += -DLIBGCC_S_SO="\"$(libgcc-so-name)\""
endif
ifeq ($(subdir),rt)
diff --git a/nptl/sysdeps/pthread/unwind-forcedunwind.c b/nptl/sysdeps/pthread/unwind-forcedunwind.c
index adce6e7..91ae374 100644
--- a/nptl/sysdeps/pthread/unwind-forcedunwind.c
+++ b/nptl/sysdeps/pthread/unwind-forcedunwind.c
@@ -21,7 +21,6 @@
#include <unwind.h>
#include <pthreadP.h>
#include <sysdep.h>
-#include <libgcc_s.h>
static void *libgcc_s_handle;
static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
diff --git a/sysdeps/generic/Makefile b/sysdeps/generic/Makefile
index f74109d..b44d8c8 100644
--- a/sysdeps/generic/Makefile
+++ b/sysdeps/generic/Makefile
@@ -20,6 +20,8 @@ ifeq ($(subdir),string)
CFLAGS-wordcopy.c += -Wno-uninitialized
endif
+CFLAGS-framestate.c += -DLIBGCC_S_SO="\"$(libgcc-so-name)\""
+
ifeq ($(subdir),elf)
ifeq (yes:yes,$(build-shared):$(unwind-find-fde))
# This is needed to support g++ v2 and v3.
diff --git a/sysdeps/generic/framestate.c b/sysdeps/generic/framestate.c
index 3638bbe..da8a07b 100644
--- a/sysdeps/generic/framestate.c
+++ b/sysdeps/generic/framestate.c
@@ -23,7 +23,6 @@
#define __frame_state_for fallback_frame_state_for
#include <unwind-dw2.c>
#undef __frame_state_for
-#include <libgcc_s.h>
typedef struct frame_state * (*framesf)(void *pc, struct frame_state *);
struct frame_state *__frame_state_for (void *pc,
diff --git a/sysdeps/generic/libgcc_s.h b/sysdeps/generic/libgcc_s.h
deleted file mode 100644
index e74a103..0000000
--- a/sysdeps/generic/libgcc_s.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Name of libgcc_s library provided by gcc. */
-#define LIBGCC_S_SO "libgcc_s.so.1"
diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
index 269c74f..0fb6bdf 100644
--- a/sysdeps/gnu/Makefile
+++ b/sysdeps/gnu/Makefile
@@ -78,11 +78,11 @@ endif
ifeq ($(subdir),csu)
routines += unwind-resume
shared-only-routines += unwind-resume
-CFLAGS-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables -DLIBGCC_S_SO="\"$(libgcc-so-name)\""
endif
ifeq ($(subdir),rt)
librt-sysdep_routines += rt-unwind-resume
librt-shared-only-routines += rt-unwind-resume
-CFLAGS-rt-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-rt-unwind-resume.c += -fexceptions -fasynchronous-unwind-tables -DLIBGCC_S_SO="\"$(libgcc-so-name)\""
endif
diff --git a/sysdeps/gnu/unwind-resume.c b/sysdeps/gnu/unwind-resume.c
index 1d3e33f..658fbd0 100644
--- a/sysdeps/gnu/unwind-resume.c
+++ b/sysdeps/gnu/unwind-resume.c
@@ -19,7 +19,6 @@
#include <dlfcn.h>
#include <stdio.h>
#include <unwind.h>
-#include <libgcc_s.h>
static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
static _Unwind_Reason_Code (*libgcc_s_personality)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/Makefile b/sysdeps/unix/sysv/linux/s390/s390-32/Makefile
index a509c93..e3b7c10 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/Makefile
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/Makefile
@@ -16,5 +16,6 @@ ifeq (yes,$(build-shared))
# This is needed to support g++ v2 and v3.
sysdep_routines += framestate
shared-only-routines += framestate
+CFLAGS-framestate.c += -DLIBGCC_S_SO="\"$(libgcc-so-name)\""
endif
endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/Makefile b/sysdeps/unix/sysv/linux/s390/s390-64/Makefile
index 283361b..6ea3102 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/Makefile
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/Makefile
@@ -7,5 +7,6 @@ ifeq (yes,$(build-shared))
# This is needed to support g++ v2 and v3.
sysdep_routines += framestate
shared-only-routines += framestate
+CFLAGS-framestate.c += -DLIBGCC_S_SO="\"$(libgcc-so-name)\""
endif
endif
--
1.7.7.6