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 19:22:47 +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> <83oarql2k6.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1417285402 16502 80.91.229.3 (29 Nov 2014 18:23:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Nov 2014 18:23:22 +0000 (UTC) Cc: 19111@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 29 19:23: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 1Xumfr-0004Lp-8d for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Nov 2014 19:23:15 +0100 Original-Received: from localhost ([::1]:48431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xumfq-000374-Ih for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Nov 2014 13:23:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xumfj-00036k-6y for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2014 13:23:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xumfe-0007Hk-Q2 for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2014 13:23:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xumfe-0007Hg-NE for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2014 13:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xumfe-0000Gp-FJ for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2014 13:23: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 18:23: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.14172853711018 (code B ref 19111); Sat, 29 Nov 2014 18:23:02 +0000 Original-Received: (at 19111) by debbugs.gnu.org; 29 Nov 2014 18:22:51 +0000 Original-Received: from localhost ([127.0.0.1]:49355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XumfT-0000GL-1p for submit@debbugs.gnu.org; Sat, 29 Nov 2014 13:22:51 -0500 Original-Received: from mail-ob0-f178.google.com ([209.85.214.178]:44020) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XumfQ-0000GD-QD for 19111@debbugs.gnu.org; Sat, 29 Nov 2014 13:22:49 -0500 Original-Received: by mail-ob0-f178.google.com with SMTP id gq1so6152636obb.37 for <19111@debbugs.gnu.org>; Sat, 29 Nov 2014 10:22:48 -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; bh=9uvB+vMSHxFeBTXOXKOmWIUh9iaFq1HAenjQX6T8jYU=; b=PmQvPaLyVAYVufdLsPaV1tyD4V8F/cqIAlTwYDc8BlqKnIfO+/RQP0jHMOAXBWV4JI EtRypU2UJVZxqlmWhvwRaweioGHZziQqR5TJVhV4FX+I8XwUDIGflRmx3kLeJJdD/3Sp KQIMoe2CF6Sqgs+JHFLsfWz75XkbzazdjULVuXtjYDlms3rNqWf51MLIS7TZVUqr9qtF tGzmYqFnAFeWhsk01hdxLqcYBGhx47ZVrnWJhyZLD5zLFrKx4aexSCb6hRDEjAkrc0sG p/7w+Xyy3VyIxksEzgp6MaGfSLZ8kz4u4iQR2ewht4P0IXd37eopX+GGURjd9wIa9k+R t6YQ== X-Received: by 10.182.24.104 with SMTP id t8mr2615192obf.44.1417285368099; Sat, 29 Nov 2014 10:22:48 -0800 (PST) Original-Received: by 10.60.47.84 with HTTP; Sat, 29 Nov 2014 10:22:47 -0800 (PST) In-Reply-To: <83oarql2k6.fsf@gnu.org> 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:96734 Archived-At: On Sat, Nov 29, 2014 at 11:32 AM, Eli Zaretskii wrote: >> Date: Sat, 29 Nov 2014 11:07:14 +0100 >> From: Dani Moncayo >> >> 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). > > Why do you think it isn't canonical? $host is not guaranteed to be canonical, because its (final) value is not produced by our AC_CANONICAL_HOST. > For that matter, what is your > definition of "canonical" in this context? The value of $host produced by AC_CANONICAL_HOST. > Verification of the canonical configurations is the job of the > config.sub script. IIUC, the job of config.sub is verification/canonization of configurations supplied explicitly as parameters in the configure script (--host, --build). > In this case, it considers all the "gcc target" > strings valid and outputs them intact, with a single exception: it > replaces "mingw32" with "i386-pc-mingw32", which is correct because > the mingw.org's development toolchain targets that host. Which means that all the gcc targets in my previous mail could be specified to 'configure' as --host. > I'm guessing you somehow think that the "pc" part must be there > verbatim. But that is incorrect: it is just the default value of > MANUFACTURER when the configuration type supplied "by other means" > doesn't provide a MANUFACTURER. Since the *-w64-*-mingw32 > configurations do provide MANUFACTURER, there's nothing wrong with > them, and they cannot cause any harm, AFAIK. I think that the "w64" manufacturer reveals that something is not quite right, because, when no --host and --build are specified, the canonical configuration should be the one produced by config.guess, and this script always uses 'pc' as MANUFACTURER (for MinGW-type systems). >> 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 > > I don't think we need that, since what we have now uses perfectly > valid canonical configuration types. In any case, if you still are > unconvinced, the way to fix this is to submit patches for config.sub, > so that it does this mapping automatically. Its that script's job, > not ours. I agree with the above, after replacing 'config.sub' with 'config.guess'. I've tried to make a patch for this, but it seems that 'config.guess' is produced by 'autogen.sh', which in turn invokes autoreconf... and this stuff is unknown to me for now. But in summary: IMO, the right fix for this seems to be in config.guess, which returns the wrong CPU on certain MSYS environments (#3 and #4 in my previous mail). This should be fixed and then 'configure.ac' should return to its previous state: diff --git a/configure.ac b/configure.ac index 010abc8..ca037ff 100644 --- a/configure.ac +++ b/configure.ac @@ -137,39 +137,12 @@ AM_INIT_AUTOMAKE(1.11) dnl Canonicalize the configuration name. AC_CANONICAL_HOST +canonical=$host +configuration=${host_alias-${build_alias-$host}} -case $host in +case $canonical 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]) - fi - . $srcdir/nt/mingw-cfg.site case $srcdir in @@ -184,9 +157,6 @@ Defaulting to $host.]) 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