bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#19111: 25.0.50; 32 bits temacs.exe is linked with wrong image-base w


From: Dani Moncayo
Subject: bug#19111: 25.0.50; 32 bits temacs.exe is linked with wrong image-base when built on 64 bit Windows host
Date: Tue, 25 Nov 2014 21:26:41 +0100

On Tue, Nov 25, 2014 at 3:38 AM, Óscar Fuentes <ofv@wanadoo.es> wrote:
> Pushed to master as 70d7aa8a289375a119f5d4e785c8a5882f0a2e99

Thank you Óscar.

I've done some test, and there is something that looks wrong to me (I
know almost nothing about these things, so correct me if I'm wrong):

IIUC, the way to explicitly tell the "destination platform" (i.e. the
"host" platform) is with the --host parameter to 'configure'.  So I've
tried this from a MSYS2 (64 bit) environment:
--------------------------------------------------
$ ./autogen.sh
[...]
$ ./configure --host=i686-pc-mingw64
[...]
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-pc-mingw32
checking host system type... i686-pc-mingw64
checking the compiler's target... i686-w64-mingw32
checking for i686-pc-mingw64-gcc... no
checking for i686-pc-mingw64-cc... no
checking for i686-pc-mingw64-cl... no
checking for i686-pc-mingw64-clang... no
checking for i686-pc-mingw64-... no
checking for i686-pc-mingw64-... no
checking for gcc... gcc
checking whether the C compiler works... yes
[...]
--------------------------------------------------

IIUC, in that case the configure script should not check the
compiler's target, because I'm suplying that information in the --host
parameter.

I think that the problem is that you are checking $target_alias, when
TRT would be to check $host_alias instead (which holds the value of
the --host parameter).

Also, if we want to avoid "transient" values of $canonical, we could
set that variable only once, when we know its final value.

At the end of this message is a patch along these lines.  I've tested
it a bit and seems to work fine.  For example:
--------------------------------------------------
$ ./autogen.sh
[...]
$ ./configure --host=i686-pc-mingw64
[...]
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-pc-mingw32
checking host system type... i686-pc-mingw64
checking for i686-pc-mingw64-gcc... no
checking for i686-pc-mingw64-cc... no
checking for i686-pc-mingw64-cl... no
checking for i686-pc-mingw64-clang... no
checking for i686-pc-mingw64-... no
checking for i686-pc-mingw64-... no
checking for gcc... gcc
checking whether the C compiler works... yes
[...]
$ ./configure
[...]
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-pc-mingw32
checking host system type... x86_64-pc-mingw32
checking the compiler's target... i686-w64-mingw32
checking for gcc... gcc
checking whether the C compiler works... yes
[...]
--------------------------------------------------

Here is the patch against the current master HEAD:

--------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 8830ec7..37dc74d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,42 +137,41 @@ AM_INIT_AUTOMAKE(1.11)

 dnl Canonicalize the configuration name.
 AC_CANONICAL_HOST
-canonical=$host
-configuration=${host_alias-${build_alias-$host}}

 dnl We get MINGW64 with MSYS2, MINGW32 with MSYS.
-case $canonical in
+case $host in
  *-mingw*)
-  . $srcdir/nt/mingw-cfg.site

   # When we build with MinGW under MSYS, we are cross-compiling. Hence
   # we can't rely on the output of MSYS `uname' for the architecture
   # (32 bit MinGW compiler with 64 bit MSYS2, for instance) and must
   # use the compiler's target, unless when the user explicitly
-  # provides one:
-  if test -z $target_alias; then
+  # provides a --host parameter
+  if test -n "$host_alias"; then
+      host=$host_alias
+  else
       AC_MSG_CHECKING([the compiler's target])
-      if test -z $CC; then
+      if test -z "$CC"; then
   cc=gcc
       else
   cc=$CC
       fi
       t=`$cc -v 2>&1 | sed -n 's/Target: //p'`
       case "$t" in
-          *-*) canonical=$t
+          *-*) host=$t
       ;;
           "") AC_MSG_ERROR([Impossible to obtain $cc compiler target.
-Please explicitly provide --target])
+Please explicitly provide --host.])
               ;;
   *) AC_MSG_WARN([Compiler reported non-standard target.
-Defaulting to $canonical.])
+Defaulting to $host.])
               ;;
       esac
-      AC_MSG_RESULT([$canonical])
-  else
-      canonical=$target_alias
+      AC_MSG_RESULT([$host])
   fi

+  . $srcdir/nt/mingw-cfg.site
+
   case $srcdir in
     /* | ?:*)
       # srcdir is an absolute path.  In this case, force the format
@@ -185,6 +184,9 @@ Defaulting to $canonical.])
   esac;;
 esac

+canonical=$host
+configuration=${host_alias-${build_alias-$host}}
+
 dnl Support for --program-prefix, --program-suffix and
 dnl --program-transform-name options
 AC_ARG_PROGRAM
--------------------------------------------------

-- 
Dani Moncayo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]