[libgfortran,patch] Don't use __USER_LABEL_PREFIX__ in alias attribute

FX Coudert fxcoudert@gmail.com
Sat Feb 3 13:05:00 GMT 2007


Hi all,

Following patch fixes a libgfortran bug that prevented from building  
on sh-elf. It did not manifest itself on other platforms (because  
they don't have a non-empty __USER_LABEL_PREFIX__). Thanks to Ian  
Taylor for his help in understanding this, and thanks to Kazumoto  
Kojima for testing it on sh-elf.

Bootstrapped and regtested on i686-linux. Tested on sh-elf. I will  
commit to mainline in 24 hours unless someone objects. I won't  
backport it to 4.2 unless there's explicit demand for it.

Thanks,
FX



2007-02-03  Francois-Xavier Coudert  <coudert@clipper.ens.fr>

	PR libfortran/30007
	* libgfortran.h: Do not prefix symbol name with
	__USER_LABEL_PREFIX__ when used in __attribute__((__alias__(...))).



Index: libgfortran/libgfortran.h
===================================================================
--- libgfortran/libgfortran.h   (revision 121540)
+++ libgfortran/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)



More information about the Fortran mailing list