From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dani Moncayo Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <87fvdfrl4p.fsf@telefonica.net> <83k32q7wkl.fsf@gnu.org> <87bno2swxp.fsf@wanadoo.es> <83egsy7d2x.fsf@gnu.org> <87siheqzq9.fsf@wanadoo.es> <83389d7t89.fsf@gnu.org> <87a93lrgct.fsf@wanadoo.es> <83mw7l6bjc.fsf@gnu.org> <87389dragi.fsf@wanadoo.es> <83egsx60um.fsf@gnu.org> <87y4r5pgae.fsf@wanadoo.es> <87ioi8pg84.fsf@wanadoo.es> <87egswpf9p.fsf@wanadoo.es> <87a93kp3lb.fsf@wanadoo.es> <9hwq6o11ud.fsf@fencepost.gnu.org> <87389cox4u.fsf@wanadoo.es> <87mw7gngw8.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1416947268 27691 80.91.229.3 (25 Nov 2014 20:27:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Nov 2014 20:27:48 +0000 (UTC) Cc: 19111@debbugs.gnu.org To: =?UTF-8?Q?=C3=93scar?= Fuentes Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 25 21:27:41 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XtMhs-0007mQ-P2 for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Nov 2014 21:27:29 +0100 Original-Received: from localhost ([::1]:59456 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtMhs-0001pP-Ba for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Nov 2014 15:27:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtMhl-0001o8-0r for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 15:27:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtMhT-0001aQ-7T for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 15:27:20 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtMhT-0001aL-4F for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 15:27:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XtMhS-0007zx-OS for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 15:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dani Moncayo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Nov 2014 20:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19111 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19111-submit@debbugs.gnu.org id=B19111.141694720530714 (code B ref 19111); Tue, 25 Nov 2014 20:27:02 +0000 Original-Received: (at 19111) by debbugs.gnu.org; 25 Nov 2014 20:26:45 +0000 Original-Received: from localhost ([127.0.0.1]:45283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtMhB-0007zK-0i for submit@debbugs.gnu.org; Tue, 25 Nov 2014 15:26:45 -0500 Original-Received: from mail-ob0-f182.google.com ([209.85.214.182]:37223) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtMh8-0007zB-A3 for 19111@debbugs.gnu.org; Tue, 25 Nov 2014 15:26:43 -0500 Original-Received: by mail-ob0-f182.google.com with SMTP id m8so1091446obr.27 for <19111@debbugs.gnu.org>; Tue, 25 Nov 2014 12:26:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=PqJ1tOW99y9GeK1AdeUwHkFGDxEd3gJ3DUd0yDrT6D8=; b=CFXc+MAZTJHDvdA+x9TAfP94UEZl+kInbIhDAqv3+etPvXXmoXos3Ogjaa/S63gJDL bzA8Qi0WY2b7ogPMTOe5Qk8oNjOZf/mjBW8As6VH1GHmg8eEcFDNNUJyX20bEoKDJG8b 5hcQSNyQNE4t77OWUfcS0EOUelLG+lfNVdgv4GCRY2dquvHKsGFtTbQlSEhUBZPDjsAT D+Q0tCKApbZ//mcyjvBZog2Jh3bhbouGG1xBSmwBaMgZxDjYSF2AwbC90kH0jGYPyEiN SuQQkr1YbEdV8NVfT/MxX6xIUEx0Xxb2VKrSmzsJg5enz+BMXE17vivgTsLRtXsbpHD8 NcrA== X-Received: by 10.202.198.21 with SMTP id w21mr15954816oif.64.1416947201502; Tue, 25 Nov 2014 12:26:41 -0800 (PST) Original-Received: by 10.60.47.84 with HTTP; Tue, 25 Nov 2014 12:26:41 -0800 (PST) In-Reply-To: <87mw7gngw8.fsf@wanadoo.es> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:96570 Archived-At: On Tue, Nov 25, 2014 at 3:38 AM, =C3=93scar Fuentes wrote: > Pushed to master as 70d7aa8a289375a119f5d4e785c8a5882f0a2e99 Thank you =C3=93scar. 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=3Di686-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=3Di686-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=3D$host -configuration=3D${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=3D$host_alias + else AC_MSG_CHECKING([the compiler's target]) - if test -z $CC; then + if test -z "$CC"; then cc=3Dgcc else cc=3D$CC fi t=3D`$cc -v 2>&1 | sed -n 's/Target: //p'` case "$t" in - *-*) canonical=3D$t + *-*) host=3D$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=3D$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=3D$host +configuration=3D${host_alias-${build_alias-$host}} + dnl Support for --program-prefix, --program-suffix and dnl --program-transform-name options AC_ARG_PROGRAM -------------------------------------------------- --=20 Dani Moncayo