[uae] Re: E-UAE on NetBSD: some patches

  • From: Richard Drummond <evilrich@xxxxxxxxxxxxxx>
  • To: uae@xxxxxxxxxxxxx
  • Date: Tue, 12 Apr 2005 14:27:11 -0500

Hi Bernhard

On Tuesday 12 April 2005 03:03 am, Bernhard Moellemann wrote:
> Hi!
>
> I found some time to get euae running on NetBSD/i386. The were three
> quirks:
>
> src/picasso96.c defines bswap32() This is already used in NetBSD and
> imported via some system includes. I checked they do the same on i386 and
> changed it to use the system one (but I cannot really test it, because
> I don't own a runnable Picasso96 installation right now):

Thanks. I will rename that.

> src/include/unzip.h uses a macro OF(x) which is not defined in NetBSD.
> It seems to be a wrapper around prototypes. NetBSDs (g)cc supports
> Prototypes so I added

Hmmm. The OF macro should be in the zlib's zconf.h header. Does NetBSD's 
version not have this (/usr/include/zconf.h?).

> NetBSDs gcc is able to link against libraries in other places as they are
> later at runtime. So the runtime location must be given with -Wl,-R.
> I patched config.status to have
> -Wl,-R/usr/pkg/lib -Wl,--export-dynamic -L/usr/pkg/lib
> and
> -Wl,-R/usr/X11R6/lib -L/usr/X11R6/lib
> in the s,@LIBS@, line. (the second one was only -L/usr/X11R6/lib in my
> config.status.) To give this via LDFLAGS on the command line didn't work.
>
> I am sure that's not The Right Thing, but I don't know The Right Thing,
> and it works.

;-)

Why is this necessary, though? What happens if you don't specify the library 
paths with the -R linker option? Is the dynamic linker unable to find the 
necessary libraries at run-time? Are the /usr/pkg/lib and /usr/X11R6/lib 
paths, for example, not already in the run-time linker's library path?

Does NetBSD use GNU ld as it's linker or something else?

I could add an --enable-rpath option to the config script to handle this, and 
it could default to enabled on NetBSD if it's really necessary.

Cheers,
Rich

Other related posts: