[Bug libfortran/30007] libgfortran doesn't build for sh-elf
fxcoudert at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Jan 18 17:28:00 GMT 2007
------- 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
More information about the Gcc-bugs
mailing list