[llvm-commits] [PATCH] GNU ld win32 should not accept version script

Eric Christopher echristo at apple.com
Tue Sep 7 16:48:20 PDT 2010


On Sep 7, 2010, at 11:22 AM, Eric Christopher wrote:

> 
> On Sep 6, 2010, at 7:03 AM, NAKAMURA Takumi wrote:
> 
>> <r112499-configure-win32-versionscript.diff.txt>
> 
> So this part I somewhat understand:
> 
> +if test "$dynamic_linker" != "Win32 ld.exe" ; then
> +  dnl Determine whether the linker supports the --version-script option.
> +  AC_LINK_VERSION_SCRIPT
> +fi
> 
> Though it'd probably be better to do a test similar to AC_PROG_GNU_LD to instead check for WIN32_LD.
> 
> That said, what's with the moving of AC_LIBTOOL_DLOPEN AND AC_LIB_LTDL?

OK, I'm still curious about this part.

However for the rest it looks like a bit of a redesign of AC_LINK_VERSION_SCRIPT is really necessary, though the hack of moving the win32 bits above the gnu ld bits should work.

What you want to really know is if and how to use a version file to successfully export symbols.  The best bet there is to rewrite AC_LINK_VERSION_SCRIPT to do that sort of thing. Basically you'll probably want a pile of macros and some host checking to figure out what you should do, e.g.:

case {$target} in
   *-*-darwin*)
      AC_DEFINE(DARWIN_EXPORT_TYPE, 1, [Define this if we should use darwin export types])
      ;;
   *-*-windows* | *-*-mingw* | *-*-cygwin*)
      AC_DEFINE(WINDOWS_EXPORT_TYPE, 1, [Define this if we should use windows .def style export types])

....

etc.  You'll need to include some of the existing checking for --version-script as well.

-eric



More information about the llvm-commits mailing list