Re: winegcc: Add support for -Ttext-segment linker flag to set image base of a dll. (try 2)
Tijl Coosemans writes: > Loading a library at a specific address not only depends on the > compile-time linker, but also on the run-time loader, so it's > probably best to implement -image-base only on PLATFORM_* where > the loader supports it. Since a target platform would then have > to choose to use PLATFORM_ELF explicitly I think it's reasonable > for PLATFORM_ELF to have a dependency on binutils>=2.20 (or > compatible) rather than a run-time test for -Ttext-segment > support. The gold linker doesn't support it even in recent binutils versions, and some systems use that by default. -- Alexandre Julliard julli...@winehq.org
Re: winegcc: Add support for -Ttext-segment linker flag to set image base of a dll. (try 2)
On 2013-03-06 12:25, Alexandre Julliard wrote: > Alexandre Julliard writes: >> Tijl Coosemans writes: >>> On 03-03-2013 17:44, André Hentschel wrote: You would rather call it PLATFORM_FREEBSD >>> >>> Well, the flag isn't FreeBSD specific. It works on all ELF targets >>> (including Linux which then wouldn't need prelink). >> >> Then it should be used by default, and you don't need to add a new >> platform for it. > > Actually, I looked into this and it isn't widely supported at all, so it > can't be the default. Ideally it would need a run-time check to see if > the option works. Wouldn't a run-time check be too much of a performance hit? Loading a library at a specific address not only depends on the compile-time linker, but also on the run-time loader, so it's probably best to implement -image-base only on PLATFORM_* where the loader supports it. Since a target platform would then have to choose to use PLATFORM_ELF explicitly I think it's reasonable for PLATFORM_ELF to have a dependency on binutils>=2.20 (or compatible) rather than a run-time test for -Ttext-segment support.
Re: winegcc: Add support for -Ttext-segment linker flag to set image base of a dll. (try 2)
Alexandre Julliard writes: > Tijl Coosemans writes: > >> On 03-03-2013 17:44, André Hentschel wrote: >>> You would rather call it PLATFORM_FREEBSD >> >> Well, the flag isn't FreeBSD specific. It works on all ELF targets >> (including Linux which then wouldn't need prelink). > > Then it should be used by default, and you don't need to add a new > platform for it. Actually, I looked into this and it isn't widely supported at all, so it can't be the default. Ideally it would need a run-time check to see if the option works. -- Alexandre Julliard julli...@winehq.org
Re: winegcc: Add support for -Ttext-segment linker flag to set image base of a dll. (try 2)
Tijl Coosemans writes: > On 03-03-2013 17:44, André Hentschel wrote: >> You would rather call it PLATFORM_FREEBSD > > Well, the flag isn't FreeBSD specific. It works on all ELF targets > (including Linux which then wouldn't need prelink). Then it should be used by default, and you don't need to add a new platform for it. -- Alexandre Julliard julli...@winehq.org
Re: winegcc: Add support for -Ttext-segment linker flag to set image base of a dll. (try 2)
On 03-03-2013 17:44, André Hentschel wrote: > Am 03.03.2013 16:58, schrieb Tijl Coosemans: >> --- >> README | 3 +++ >> tools/winegcc/utils.h | 3 ++- >> tools/winegcc/winegcc.c | 11 ++- >> 3 files changed, 15 insertions(+), 2 deletions(-) >> >> diff --git a/README b/README >> index 783e798..75aff5a 100644 >> --- a/README >> +++ b/README >> @@ -40,6 +40,9 @@ support kernel threads may be supported in the future. >> >> FreeBSD info: >>Wine will generally not work properly on versions before FreeBSD 7.0. >> + You need GCC with GNU Binutils 2.20 or higher and run configure with >> + environment variables like CC, CFLAGS, CXX, CXXFLAGS, CPP, CPPFLAGS, >> + LD and LDFLAGS set correctly to use this compiler and linker. >>See http://wiki.freebsd.org/Wine for more information. > > Do you really need that? is there no script on freebsd to set the > compiler toolchain or something? This is only if you run configure directly. If you build Wine using the ports system everything is set up for you. >> enum target_platform >> { >> -PLATFORM_UNSPECIFIED, PLATFORM_APPLE, PLATFORM_SOLARIS, >> PLATFORM_WINDOWS, PLATFORM_CYGWIN >> +PLATFORM_UNSPECIFIED, PLATFORM_APPLE, PLATFORM_SOLARIS, PLATFORM_ELF, >> +PLATFORM_WINDOWS, PLATFORM_CYGWIN >> }; > > You would rather call it PLATFORM_FREEBSD Well, the flag isn't FreeBSD specific. It works on all ELF targets (including Linux which then wouldn't need prelink). >> +if (opts->image_base && !opts->target && opts->target_platform == >> PLATFORM_UNSPECIFIED) > > I'm in doubt here It's to make sure prelink isn't run when image base has already been handled.
Re: winegcc: Add support for -Ttext-segment linker flag to set image base of a dll. (try 2)
Am 03.03.2013 16:58, schrieb Tijl Coosemans: > --- > README | 3 +++ > tools/winegcc/utils.h | 3 ++- > tools/winegcc/winegcc.c | 11 ++- > 3 files changed, 15 insertions(+), 2 deletions(-) > > diff --git a/README b/README > index 783e798..75aff5a 100644 > --- a/README > +++ b/README > @@ -40,6 +40,9 @@ support kernel threads may be supported in the future. > > FreeBSD info: >Wine will generally not work properly on versions before FreeBSD 7.0. > + You need GCC with GNU Binutils 2.20 or higher and run configure with > + environment variables like CC, CFLAGS, CXX, CXXFLAGS, CPP, CPPFLAGS, > + LD and LDFLAGS set correctly to use this compiler and linker. >See http://wiki.freebsd.org/Wine for more information. > Do you really need that? is there no script on freebsd to set the compiler toolchain or something? > > enum target_platform > { > -PLATFORM_UNSPECIFIED, PLATFORM_APPLE, PLATFORM_SOLARIS, > PLATFORM_WINDOWS, PLATFORM_CYGWIN > +PLATFORM_UNSPECIFIED, PLATFORM_APPLE, PLATFORM_SOLARIS, PLATFORM_ELF, > +PLATFORM_WINDOWS, PLATFORM_CYGWIN > }; > You would rather call it PLATFORM_FREEBSD > +if (opts->image_base && !opts->target && opts->target_platform == > PLATFORM_UNSPECIFIED) I'm in doubt here -- Best Regards, André Hentschel