PATCH: attribute used for dllname

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

When used with -funit-at-a-time optimization, "static const char foo[];" 
is optimized away without reference in the file.

Since without stub functions the only reference is within an asm() statement
the compiler thinks it is used and throws it away.

Ciao, Marcus

Changelog:
	Used __attribute__((used)) on dllname, or newer gcc optimizations
	throw dllname away.

Index: tools/winebuild/spec32.c
===================================================================
RCS file: /home/wine/wine/tools/winebuild/spec32.c,v
retrieving revision 1.65
diff -u -r1.65 spec32.c
--- tools/winebuild/spec32.c	3 Apr 2003 18:05:17 -0000	1.65
+++ tools/winebuild/spec32.c	28 Jul 2003 05:54:57 -0000
@@ -496,7 +496,11 @@
     fprintf( outfile, "}\n" );
     fprintf( outfile, "#endif\n" );
 
+    fprintf( outfile, "#ifdef __GNUC__\n" );
+    fprintf( outfile, "static const char __attribute__((used)) dllname[] = \"%s\";\n\n", dll_file_name );
+    fprintf( outfile, "#else\n" );
     fprintf( outfile, "static const char dllname[] = \"%s\";\n\n", dll_file_name );
+    fprintf( outfile, "#endif\n" );
     fprintf( outfile, "extern int __wine_spec_exports[];\n\n" );
 
 #ifdef __i386__


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux