From a07ee50e95c6176ea58919254e4001a15dd7622b Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 5 Mar 2013 11:54:29 +0000 Subject: [PATCH] * configure.host: Add x86_64-*-cygwin* as valid host. * configure.tgt: Add x86_64-*-cygwin* as valid target. * emultempl/pep.em: Handle different requirements for Cygwin in terms of start addresses for executables and DLLs, based on memory model in http://cygwin.com/ml/cygwin-developers/2013-02/msg00027.html --- ld/ChangeLog | 8 ++++++++ ld/configure.host | 2 +- ld/configure.tgt | 6 +++++- ld/emultempl/pep.em | 44 ++++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 56 insertions(+), 4 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index d24b266..ec75b6b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2013-03-05 Corinna Vinschen + + * configure.host: Add x86_64-*-cygwin* as valid host. + * configure.tgt: Add x86_64-*-cygwin* as valid target. + * emultempl/pep.em: Handle different requirements for Cygwin in terms + of start addresses for executables and DLLs, based on memory model in + http://cygwin.com/ml/cygwin-developers/2013-02/msg00027.html + 2013-03-05 Alan Modra PR ld/15222 diff --git a/ld/configure.host b/ld/configure.host index ab7bc7d..c56f67d 100644 --- a/ld/configure.host +++ b/ld/configure.host @@ -171,7 +171,7 @@ i[3-7]86-pc-interix*) HOSTING_LIBS='-L $$X/local_bin -L $$INTERIX_ROOT/usr/lib '"$HOSTING_LIBS"' -lcpsx -lc -lcpsx $$INTERIX_ROOT/usr/lib/psxdll.a $$INTERIX_ROOT/usr/lib/psxdll2.a' ;; -i[3-7]86-*-cygwin*) +i[3-7]86-*-cygwin* | x86_64-*-cygwin*) HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -L/usr/lib/w32api -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`' ;; diff --git a/ld/configure.tgt b/ld/configure.tgt index b015dde..3b06dd3 100644 --- a/ld/configure.tgt +++ b/ld/configure.tgt @@ -316,6 +316,10 @@ i[3-7]86-*-mingw32*) targ_emul=i386pe ; x86_64-*-pe | x86_64-*-pep) targ_emul=i386pep ; targ_extra_emuls=i386pe ; targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o" ;; +x86_64-*-cygwin) targ_emul=i386pep ; + targ_extra_emuls=i386pe + targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o" + test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' ;; x86_64-*-mingw*) targ_emul=i386pep ; targ_extra_emuls=i386pe targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o" ;; @@ -821,7 +825,7 @@ spu-*-elf*) NATIVE_LIB_DIRS='/lib' ;; -i[03-9x]86-*-cygwin*) +i[03-9x]86-*-cygwin* | x86_64-*-cygwin*) NATIVE_LIB_DIRS='/usr/lib /usr/lib/w32api' ;; diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index 12b7598..3e8b65e 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -5,6 +5,16 @@ if [ -z "$MACHINE" ]; then else OUTPUT_ARCH=${ARCH}:${MACHINE} fi + +case ${target} in + *-*-cygwin*) + move_default_addr_high=1 + ;; + *) + move_default_addr_high=0; + ;; +esac + rm -f e${EMULATION_NAME}.c (echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-) fragment <