public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH: mingw32.h: define JCR_SECTION_NAME when cross compiling and  weak symbols are not supported by the build machine
@ 2008-06-30  2:05 Marcelo Slomp
  2008-07-02  7:15 ` Danny Smith
  0 siblings, 1 reply; 2+ messages in thread
From: Marcelo Slomp @ 2008-06-30  2:05 UTC (permalink / raw)
  To: gcc-patches

Problem: cross compiling GCC 4.x series for the mingw32 target fails in gcc/config/i386/cygming-crtbegin.c due to a__JCR_LIST__ conflict.
There is a post in the mingw-users list archives that expose this issue:
http://lists-archives.org/mingw-users/09432-help-cross-compile-cygming-crtbegin-c-compile-error.html

Solution: JCR_SECTION_NAME is defined only if weak symbols are supported. (gcc/defaults.h:363)
This is valid, for example, in a native mingw32 build, but this is not ever true when cross compiling,
depending on the build machine (here, i686-pc-linux-gnu).
In these cases, we need define it, because TARGET_USE_JCR_SECTION is always 1, causing the problem
mentioned in the post above (now gcc/config/i386/cygming-crtbegin.c:80 - no :72).

Marcelo A. B. Slomp

2008-06-29  Marcelo Slomp  <mslomp@linuxmail.org>

	* gcc/config/i386/mingw32.h: define JCR_SECTION_NAME

Index: gcc/config/i386/mingw32.h
===================================================================
--- gcc/config/i386/mingw32.h.orig	(revision 137261)
+++ gcc/config/i386/mingw32.h	(modified version)
@@ -163,6 +163,9 @@ do {						         \
  /* JCR_SECTION works on mingw32.  */
  #undef TARGET_USE_JCR_SECTION
  #define TARGET_USE_JCR_SECTION 1
+#ifndef JCR_SECTION_NAME
+#define JCR_SECTION_NAME ".jcr"
+#endif
  
  #undef MINGW_ENABLE_EXECUTE_STACK
  #define MINGW_ENABLE_EXECUTE_STACK     \


=


-- 
Powered by Outblaze

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: mingw32.h: define JCR_SECTION_NAME when cross compiling and weak symbols are not supported by the build machine
  2008-06-30  2:05 PATCH: mingw32.h: define JCR_SECTION_NAME when cross compiling and weak symbols are not supported by the build machine Marcelo Slomp
@ 2008-07-02  7:15 ` Danny Smith
  0 siblings, 0 replies; 2+ messages in thread
From: Danny Smith @ 2008-07-02  7:15 UTC (permalink / raw)
  To: Marcelo Slomp; +Cc: gcc-patches

On Mon, Jun 30, 2008 at 1:14 PM, Marcelo Slomp <mslomp@linuxmail.org> wrote:
> Problem: cross compiling GCC 4.x series for the mingw32 target fails in gcc/config/i386/cygming-crtbegin.c due to a__JCR_LIST__ conflict.
> There is a post in the mingw-users list archives that expose this issue:
> http://lists-archives.org/mingw-users/09432-help-cross-compile-cygming-crtbegin-c-compile-error.html
>
> Solution: JCR_SECTION_NAME is defined only if weak symbols are supported. (gcc/defaults.h:363)
> This is valid, for example, in a native mingw32 build, but this is not ever true when cross compiling,
> depending on the build machine (here, i686-pc-linux-gnu).
> In these cases, we need define it, because TARGET_USE_JCR_SECTION is always 1, causing the problem
> mentioned in the post above (now gcc/config/i386/cygming-crtbegin.c:80 - no :72).
>
> Marcelo A. B. Slomp


The problem was that we were always  using .,jcr section  without
regard for GAS_HAVE_WEAK
I have applied this patch to fix.

2008-07-02  Danny Smith  <dannysmith@users.sourceforge.net>

	* config/i386/mingw32.h (TARGET_USE_JCR_SECTION): Undef to let
	defaults.h definition apply.

Index: config/i386/mingw32.h
===================================================================
--- config/i386/mingw32.h	(revision 137339)
+++ config/i386/mingw32.h	(working copy)
@@ -160,9 +160,8 @@
 #undef TARGET_N_FORMAT_TYPES
 #define TARGET_N_FORMAT_TYPES 3

-/* JCR_SECTION works on mingw32.  */
+/* Let defaults.h definition of TARGET_USE_JCR_SECTION apply. */
 #undef TARGET_USE_JCR_SECTION
-#define TARGET_USE_JCR_SECTION 1

 #undef MINGW_ENABLE_EXECUTE_STACK
 #define MINGW_ENABLE_EXECUTE_STACK     \

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-02  6:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-30  2:05 PATCH: mingw32.h: define JCR_SECTION_NAME when cross compiling and weak symbols are not supported by the build machine Marcelo Slomp
2008-07-02  7:15 ` Danny Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).