[Bug libfortran/30007] libgfortran doesn't build for sh-elf
--- Comment #10 from fxcoudert at gcc dot gnu dot org 2007-02-04 10:30 --- Fixed on mainline. -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007
[Bug libfortran/30007] libgfortran doesn't build for sh-elf
--- Comment #9 from fxcoudert at gcc dot gnu dot org 2007-02-04 10:30 --- Subject: Bug 30007 Author: fxcoudert Date: Sun Feb 4 10:30:17 2007 New Revision: 121569 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121569 Log: PR libfortran/30007 * libgfortran.h: Do not prefix symbol name with __USER_LABEL_PREFIX__ when used in __attribute__((__alias__(...))). Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/libgfortran.h -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007
[Bug libfortran/30007] libgfortran doesn't build for sh-elf
-- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Keywords||patch Target Milestone|--- |4.3.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007
[Bug libfortran/30007] libgfortran doesn't build for sh-elf
--- Comment #8 from kkojima at gcc dot gnu dot org 2007-02-03 07:12 --- With your patch in #6, the trunk gcc is built successfully on sh-elf for --enable-languages=c,fortran configuration. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007
[Bug libfortran/30007] libgfortran doesn't build for sh-elf
--- Comment #7 from fxcoudert at gcc dot gnu dot org 2007-02-02 16:19 --- CCing SH maintainers. I'm looking for someone to test the patch in comment #6 on a machine where __USER_LABEL_PREFIX__ is not empty. -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added CC||aoliva at gcc dot gnu dot ||org, kkojima at gcc dot gnu ||dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007
[Bug libfortran/30007] libgfortran doesn't build for sh-elf
--- Comment #6 from fxcoudert at gcc dot gnu dot org 2007-01-18 18:49 --- (In reply to comment #5) > __USER_LABEL_PREFIX__ should be a string already. > > so you just need: > extern void bar (void); > extern __typeof(bar) bar __asm__(__USER_LABEL_PREFIX__ "foo"); > void bar (void) { ; } > extern __typeof(bar) gee __attribute__((__alias__("foo"))); That one gives: c.c:2: error: expected string literal before _ __USER_LABEL_PREFIX__ is a string in the compiler config macros. For user code, the macro expands to the underscore itself. Actually, the problem with libgfortran is that it uses __USER_LABEL_PREFIX__ already, but it uses it for both __asm__ and __attribute__((__alias__(...))), which is wrong. I'm testing the following patch, but I should really test it on a machine that has a non-empty __USER_LABEL_PREFIX__. Any idea? Index: libgfortran.h === --- libgfortran.h (revision 120891) +++ libgfortran.h (working copy) @@ -126,10 +126,10 @@ # define export_proto(x) sym_rename(x, PREFIX(x)) # define export_proto_np(x)extern char swallow_semicolon # define iexport_proto(x) internal_proto(x) -# define iexport(x)iexport1(x, __USER_LABEL_PREFIX__, IPREFIX(x)) -# define iexport1(x,p,y) iexport2(x,p,y) -# define iexport2(x,p,y) \ - extern __typeof(x) PREFIX(x) __attribute__((__alias__(#p #y))) +# define iexport(x)iexport1(x, IPREFIX(x)) +# define iexport1(x,y) iexport2(x,y) +# define iexport2(x,y) \ + extern __typeof(x) PREFIX(x) __attribute__((__alias__(#y))) /* ??? We're not currently building a dll, and it's wrong to add dllexport to objects going into a static library archive. */ #elif 0 && defined(HAVE_ATTRIBUTE_DLLEXPORT) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007
[Bug libfortran/30007] libgfortran doesn't build for sh-elf
--- Comment #5 from pinskia at gcc dot gnu dot org 2007-01-18 17:52 --- __USER_LABEL_PREFIX__ should be a string already. so you just need: extern void bar (void); extern __typeof(bar) bar __asm__(__USER_LABEL_PREFIX__ "foo"); void bar (void) { ; } extern __typeof(bar) gee __attribute__((__alias__("foo"))); -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007
[Bug libfortran/30007] libgfortran doesn't build for sh-elf
--- Comment #4 from fxcoudert at gcc dot gnu dot org 2007-01-18 17:28 --- So, the reduced code looks like this: extern void bar (void); extern __typeof(bar) bar __asm__("foo"); void bar (void) { ; } extern __typeof(bar) gee __attribute__((__alias__("foo"))); Ian Lance Taylor gave me the solution on IRC, which is: on SH, all symbol names are preprended an underscore, but in the above code __asm__("foo") does not prepend it for us. The macro defined for this underscore (and other such prefixes on other targets, although I don't any in particular) is __USER_LABEL_PREFIX__, so the final fix is: #define stringize(x) expand_macro(x) #define expand_macro(x) # x extern void bar (void); extern __typeof(bar) bar __asm__(stringize(__USER_LABEL_PREFIX__) "foo"); void bar (void) { ; } extern __typeof(bar) gee __attribute__((__alias__("foo"))); -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2007-01-05 10:10:35 |2007-01-18 17:28:42 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007
[Bug libfortran/30007] libgfortran doesn't build for sh-elf
--- Comment #3 from fxcoudert at gcc dot gnu dot org 2007-01-05 10:10 --- Confirmed as it has been reported by other people as well. I don't understand enough of this name aliasing to understand the reason for this bug. Can you confirm that the following is enough to trigger the bug? If that's the case, then maybe a post to the gcc mailing-list would be a good thing. extern void runtime_error (const char *) __attribute__ ((noreturn)); extern __typeof(runtime_error) runtime_error __asm__("_" "_gfortrani_runtime_error") __attribute__((__visibility__("hidden"))); void runtime_error (const char *message) { ; } extern __typeof(runtime_error) _gfortran_runtime_error __attribute__((__alias__("_" "_gfortrani_runtime_error"))); -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-01-05 10:10:35 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007
[Bug libfortran/30007] libgfortran doesn't build for sh-elf
--- Comment #2 from amylaar at gcc dot gnu dot org 2006-12-04 14:37 --- Created an attachment (id=12740) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12740&action=view) preprocessed source The sub-command that fails using --save-temps -v is: /home/amylaar/bld/2006-11-27/sh-elf/./gcc/cc1 -fpreprocessed error.i -quiet -dumpbase error.c -auxbase-strip error.o -g -O2 -O2 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -std=gnu99 -version -o error.s -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007
[Bug libfortran/30007] libgfortran doesn't build for sh-elf
--- Comment #1 from pinskia at gcc dot gnu dot org 2006-12-02 07:56 --- I don't run into this failure when building libgfortran for spu-elf. Can you provide the preprocessed temp? Also by the way newlib for most targets don't have enough of POSIX to be able to run the libgfortran testsuite, it is missing dup and access at least. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007