public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/30007]  New: libgfortran doesn't build for sh-elf
@ 2006-11-28 11:10 amylaar at gcc dot gnu dot org
  2006-12-02  7:57 ` [Bug libfortran/30007] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-11-28 11:10 UTC (permalink / raw)
  To: gcc-bugs

This is a presistent failure for more than two weeks now.
last tested with revision: 119261
build script is on gcc01 in ~amylaar/bin/sh-regtest-20061127.

/home/amylaar/bld/2006-11-27/sh-elf/./gcc/xgcc
-B/home/amylaar/bld/2006-11-27/sh-elf/./gcc/ -nostdinc
-B/home/amylaar/bld/2006-11-27/sh-elf/sh-elf/newlib/ -isystem
/home/amylaar/bld/2006-11-27/sh-elf/sh-elf/newlib/targ-include -isystem
/home/amylaar/bld/2006-11-27/srcw/newlib/libc/include -B/usr/local/sh-elf/bin/
-B/usr/local/sh-elf/lib/ -isystem /usr/local/sh-elf/include -isystem
/usr/local/sh-elf/sys-include -L/home/amylaar/bld/2006-11-27/sh-elf/./ld
-DHAVE_CONFIG_H -I. -I../../../srcw/libgfortran -I.
-iquote../../../srcw/libgfortran/io -I../../../srcw/libgfortran/../gcc
-I../../../srcw/libgfortran/../gcc/config -I../.././gcc -D_GNU_SOURCE
-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -Wextra -Wwrite-strings -O2 -g -O2 -c
../../../srcw/libgfortran/runtime/error.c -o error.o
../../../srcw/libgfortran/runtime/error.c:334: error: '_gfortran_runtime_error'
aliased to undefined symbol '__gfortrani_runtime_error'
make[2]: *** [error.lo] Error 1
make[2]: Leaving directory
`/home/amylaar/bld/2006-11-27/sh-elf/sh-elf/libgfortran'


-- 
           Summary: libgfortran doesn't build for sh-elf
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: amylaar at gcc dot gnu dot org
GCC target triplet: sh-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007


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

* [Bug libfortran/30007] libgfortran doesn't build for sh-elf
  2006-11-28 11:10 [Bug libfortran/30007] New: libgfortran doesn't build for sh-elf amylaar at gcc dot gnu dot org
@ 2006-12-02  7:57 ` pinskia at gcc dot gnu dot org
  2006-12-04 14:37 ` amylaar at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-02  7:57 UTC (permalink / raw)
  To: gcc-bugs



------- 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


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

* [Bug libfortran/30007] libgfortran doesn't build for sh-elf
  2006-11-28 11:10 [Bug libfortran/30007] New: libgfortran doesn't build for sh-elf amylaar at gcc dot gnu dot org
  2006-12-02  7:57 ` [Bug libfortran/30007] " pinskia at gcc dot gnu dot org
@ 2006-12-04 14:37 ` amylaar at gcc dot gnu dot org
  2007-01-05 10:10 ` fxcoudert at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-12-04 14:37 UTC (permalink / raw)
  To: gcc-bugs



------- 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


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

* [Bug libfortran/30007] libgfortran doesn't build for sh-elf
  2006-11-28 11:10 [Bug libfortran/30007] New: libgfortran doesn't build for sh-elf amylaar at gcc dot gnu dot org
  2006-12-02  7:57 ` [Bug libfortran/30007] " pinskia at gcc dot gnu dot org
  2006-12-04 14:37 ` amylaar at gcc dot gnu dot org
@ 2007-01-05 10:10 ` fxcoudert at gcc dot gnu dot org
  2007-01-18 17:28 ` fxcoudert at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-01-05 10:10 UTC (permalink / raw)
  To: gcc-bugs



------- 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|0000-00-00 00:00:00         |2007-01-05 10:10:35
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007


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

* [Bug libfortran/30007] libgfortran doesn't build for sh-elf
  2006-11-28 11:10 [Bug libfortran/30007] New: libgfortran doesn't build for sh-elf amylaar at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-01-05 10:10 ` fxcoudert at gcc dot gnu dot org
@ 2007-01-18 17:28 ` fxcoudert at gcc dot gnu dot org
  2007-01-18 17:52 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-01-18 17:28 UTC (permalink / raw)
  To: gcc-bugs



------- 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


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

* [Bug libfortran/30007] libgfortran doesn't build for sh-elf
  2006-11-28 11:10 [Bug libfortran/30007] New: libgfortran doesn't build for sh-elf amylaar at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-01-18 17:28 ` fxcoudert at gcc dot gnu dot org
@ 2007-01-18 17:52 ` pinskia at gcc dot gnu dot org
  2007-01-18 18:49 ` fxcoudert at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-01-18 17:52 UTC (permalink / raw)
  To: gcc-bugs



------- 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


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

* [Bug libfortran/30007] libgfortran doesn't build for sh-elf
  2006-11-28 11:10 [Bug libfortran/30007] New: libgfortran doesn't build for sh-elf amylaar at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-01-18 17:52 ` pinskia at gcc dot gnu dot org
@ 2007-01-18 18:49 ` fxcoudert at gcc dot gnu dot org
  2007-02-02 16:19 ` fxcoudert at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-01-18 18:49 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1876 bytes --]



------- 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


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

* [Bug libfortran/30007] libgfortran doesn't build for sh-elf
  2006-11-28 11:10 [Bug libfortran/30007] New: libgfortran doesn't build for sh-elf amylaar at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-01-18 18:49 ` fxcoudert at gcc dot gnu dot org
@ 2007-02-02 16:19 ` fxcoudert at gcc dot gnu dot org
  2007-02-03  7:13 ` kkojima at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-02-02 16:19 UTC (permalink / raw)
  To: gcc-bugs



------- 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


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

* [Bug libfortran/30007] libgfortran doesn't build for sh-elf
  2006-11-28 11:10 [Bug libfortran/30007] New: libgfortran doesn't build for sh-elf amylaar at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-02-02 16:19 ` fxcoudert at gcc dot gnu dot org
@ 2007-02-03  7:13 ` kkojima at gcc dot gnu dot org
  2007-02-03 13:05 ` fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2007-02-03  7:13 UTC (permalink / raw)
  To: gcc-bugs



------- 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


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

* [Bug libfortran/30007] libgfortran doesn't build for sh-elf
  2006-11-28 11:10 [Bug libfortran/30007] New: libgfortran doesn't build for sh-elf amylaar at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-02-03  7:13 ` kkojima at gcc dot gnu dot org
@ 2007-02-03 13:05 ` fxcoudert at gcc dot gnu dot org
  2007-02-04 10:30 ` fxcoudert at gcc dot gnu dot org
  2007-02-04 10:31 ` fxcoudert at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-02-03 13:05 UTC (permalink / raw)
  To: gcc-bugs



-- 

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


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

* [Bug libfortran/30007] libgfortran doesn't build for sh-elf
  2006-11-28 11:10 [Bug libfortran/30007] New: libgfortran doesn't build for sh-elf amylaar at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2007-02-03 13:05 ` fxcoudert at gcc dot gnu dot org
@ 2007-02-04 10:30 ` fxcoudert at gcc dot gnu dot org
  2007-02-04 10:31 ` fxcoudert at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-02-04 10:30 UTC (permalink / raw)
  To: gcc-bugs



------- 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


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

* [Bug libfortran/30007] libgfortran doesn't build for sh-elf
  2006-11-28 11:10 [Bug libfortran/30007] New: libgfortran doesn't build for sh-elf amylaar at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2007-02-04 10:30 ` fxcoudert at gcc dot gnu dot org
@ 2007-02-04 10:31 ` fxcoudert at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-02-04 10:31 UTC (permalink / raw)
  To: gcc-bugs



------- 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


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

end of thread, other threads:[~2007-02-04 10:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-28 11:10 [Bug libfortran/30007] New: libgfortran doesn't build for sh-elf amylaar at gcc dot gnu dot org
2006-12-02  7:57 ` [Bug libfortran/30007] " pinskia at gcc dot gnu dot org
2006-12-04 14:37 ` amylaar at gcc dot gnu dot org
2007-01-05 10:10 ` fxcoudert at gcc dot gnu dot org
2007-01-18 17:28 ` fxcoudert at gcc dot gnu dot org
2007-01-18 17:52 ` pinskia at gcc dot gnu dot org
2007-01-18 18:49 ` fxcoudert at gcc dot gnu dot org
2007-02-02 16:19 ` fxcoudert at gcc dot gnu dot org
2007-02-03  7:13 ` kkojima at gcc dot gnu dot org
2007-02-03 13:05 ` fxcoudert at gcc dot gnu dot org
2007-02-04 10:30 ` fxcoudert at gcc dot gnu dot org
2007-02-04 10:31 ` fxcoudert at gcc dot gnu dot org

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).