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: Sat, 29 Nov 2014 11:07:14 +0100 Message-ID: References: <87fvdfrl4p.fsf@telefonica.net> <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> <87egsrnguj.fsf@wanadoo.es> <873896onl2.fsf@wanadoo.es> <87y4qyn840.fsf@wanadoo.es> <83zjbeoc40.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a113d29d4afae5f0508fc8a82 X-Trace: ger.gmane.org 1417255702 3027 80.91.229.3 (29 Nov 2014 10:08:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Nov 2014 10:08:22 +0000 (UTC) To: 19111@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 29 11:08:16 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 1Xuewp-0006hJ-Vl for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Nov 2014 11:08:16 +0100 Original-Received: from localhost ([::1]:47144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xuewp-0002fu-ES for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Nov 2014 05:08:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xuewi-0002fo-1S for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2014 05:08:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xuewd-0002uX-0f for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2014 05:08:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xuewc-0002uT-Sj for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2014 05:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xuewc-0003nX-JE for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2014 05:08: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: Sat, 29 Nov 2014 10:08: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.141725563914540 (code B ref 19111); Sat, 29 Nov 2014 10:08:02 +0000 Original-Received: (at 19111) by debbugs.gnu.org; 29 Nov 2014 10:07:19 +0000 Original-Received: from localhost ([127.0.0.1]:48850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xuevu-0003mR-9m for submit@debbugs.gnu.org; Sat, 29 Nov 2014 05:07:18 -0500 Original-Received: from mail-ob0-f173.google.com ([209.85.214.173]:38049) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xuevr-0003mI-JH for 19111@debbugs.gnu.org; Sat, 29 Nov 2014 05:07:16 -0500 Original-Received: by mail-ob0-f173.google.com with SMTP id uy5so5956853obc.4 for <19111@debbugs.gnu.org>; Sat, 29 Nov 2014 02:07:15 -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 :content-type; bh=OlAFjL+L3UBBYerZcXGyab0Fj9NkUNF7eLwaZgLbMk0=; b=UlO3vykQNh/xDn3MxQQD02kE4n5lM/Zd1lg+1ijrEKvnzgPKR9r8jFXi1bbg83Wo2I 7SvJhhPJLOcGOOVTSE5HPnG97e9y4Ql0Ttm/YQkuZiJNqu2m2JjstsrChyepqVqcAxYc aqg0SI0V6zS0F0mi3FvRmhVhqrhage4vTIYsb9H1Bjcsf7qAHlEaN9smSyf6vWEvWvw0 68F7uI1DUlEEJ6cWQnXoc3QUwC2EfFeQlYSRTLFiufnTnyQnqk6jYLgsyHayaYfER83D 7ZUcsL7QY7k7hLHRHGLZkMYiaRIUDMQCLDRhuGi3MBbCljPHx057BYnNUbMEe6/a0Yi7 rMKQ== X-Received: by 10.202.68.2 with SMTP id r2mr28270892oia.49.1417255635090; Sat, 29 Nov 2014 02:07:15 -0800 (PST) Original-Received: by 10.60.47.84 with HTTP; Sat, 29 Nov 2014 02:07:14 -0800 (PST) In-Reply-To: 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:96722 Archived-At: --001a113d29d4afae5f0508fc8a82 Content-Type: text/plain; charset=UTF-8 Hello, I have to say that I still don't like the way of determining the host platform on MinGW builds, because we are setting $host and $canonical to a value (the compiler's target) that is not guaranteed to be canonical (and in fact is not canonical in the cases I've tried, see below). The following table shows the canonical host (as given by 'build-aux/config.guess') and gcc target taken from the 5 different build environments for MS-Windows I know of: # MSYS type $MSYSTEM canonical host gcc target - ----------- -------- ----------------- ------------------ 1 MSYS MINGW32 i686-pc-mingw32 mingw32 2 MSYS2-32bit MINGW32 i686-pc-mingw32 i686-w64-mingw32 3 MSYS2-32bit MINGW64 i686-pc-mingw64 x86_64-w64-mingw32 4 MSYS2-64bit MINGW32 x86_64-pc-mingw32 i686-w64-mingw32 5 MSYS2-64bit MINGW64 x86_64-pc-mingw64 x86_64-w64-mingw32 ------------------------------------------------------------------ As you can see, our problem is only in the environments 3 and 4, where the first part of the canonical triplet (CPU in CPU-VENDOR-OS) is not what we want. But note that this problem is easily fixable: the CPU we want can be deduced from the OS part of the triplet: * mingw32 --> i686 * mingw64 --> x86_64 The following patch (also attached) is an attempt to fix this. WDYT? diff --git a/configure.ac b/configure.ac index 010abc8..d7a17f2 100644 --- a/configure.ac +++ b/configure.ac @@ -142,32 +142,18 @@ case $host in *-mingw*) if test -z "$host_alias"; then - - # No --host argument was given to 'configure'; therefore $host - # was set to a default value based on the build platform. But - # this default value may be wrong if we are building from a - # 64-bit MSYS[2] pre-configured to build 32-bit MinGW programs. - # Therefore, we'll try to get the right host platform from the - # compiler's target. - - AC_MSG_CHECKING([the compiler's target]) - if test -z "$CC"; then - cc=gcc - else - cc=$CC - fi - cc_target=`$cc -v 2>&1 | sed -n 's/Target: //p'` - case "$cc_target" in - *-*) host=$cc_target - ;; - "") AC_MSG_ERROR([Impossible to obtain $cc compiler target. -Please explicitly provide --host.]) - ;; - *) AC_MSG_WARN([Compiler reported non-standard target. -Defaulting to $host.]) - ;; - esac - AC_MSG_RESULT([$host]) + # No --host argument was given; therefore $host was set to $build. + # But this default value is wrong if we are building from MSYS2 + # 64-bit with the mingw32 shell, or from MSYS2 32-bit with the + # mingw64 shell. So we have to amend $host in those cases. + host1=`AS_ECHO $host | sed \ + -e 's/x86_64-pc-mingw32/i686-pc-mingw32/' \ + -e 's/i686-pc-mingw64/x86_64-pc-mingw64/'` + + if test "$host1" != "$host"; then + host=$host1 + AC_MSG_WARN([host system type amended to $host]) + fi fi . $srcdir/nt/mingw-cfg.site -- Dani Moncayo --001a113d29d4afae5f0508fc8a82 Content-Type: text/plain; charset=US-ASCII; name="tmp.diff" Content-Disposition: attachment; filename="tmp.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i32ta5un0 ZGlmZiAtLWdpdCBhL2NvbmZpZ3VyZS5hYyBiL2NvbmZpZ3VyZS5hYwppbmRleCAwMTBhYmM4Li5k N2ExN2YyIDEwMDY0NAotLS0gYS9jb25maWd1cmUuYWMKKysrIGIvY29uZmlndXJlLmFjCkBAIC0x NDIsMzIgKzE0MiwxOCBAQCBjYXNlICRob3N0IGluCiAgKi1taW5ndyopCiAKICAgaWYgdGVzdCAt eiAiJGhvc3RfYWxpYXMiOyB0aGVuCi0KLSAgICAgICMgTm8gLS1ob3N0IGFyZ3VtZW50IHdhcyBn aXZlbiB0byAnY29uZmlndXJlJzsgdGhlcmVmb3JlICRob3N0Ci0gICAgICAjIHdhcyBzZXQgdG8g YSBkZWZhdWx0IHZhbHVlIGJhc2VkIG9uIHRoZSBidWlsZCBwbGF0Zm9ybS4gIEJ1dAotICAgICAg IyB0aGlzIGRlZmF1bHQgdmFsdWUgbWF5IGJlIHdyb25nIGlmIHdlIGFyZSBidWlsZGluZyBmcm9t IGEKLSAgICAgICMgNjQtYml0IE1TWVNbMl0gcHJlLWNvbmZpZ3VyZWQgdG8gYnVpbGQgMzItYml0 IE1pbkdXIHByb2dyYW1zLgotICAgICAgIyBUaGVyZWZvcmUsIHdlJ2xsIHRyeSB0byBnZXQgdGhl IHJpZ2h0IGhvc3QgcGxhdGZvcm0gZnJvbSB0aGUKLSAgICAgIC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