From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: add etc/PROBLEMS entry for building 32-bit exe on 64-bit system Date: Sun, 14 Jan 2007 18:23:49 -0500 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1168887056 17455 80.91.229.12 (15 Jan 2007 18:50:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 15 Jan 2007 18:50:56 +0000 (UTC) Cc: schwab@suse.de, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 15 19:50:54 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H6VbD-00032a-LQ for ged-emacs-devel@m.gmane.org; Mon, 15 Jan 2007 18:26:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H6EjM-0005cD-DK for ged-emacs-devel@m.gmane.org; Sun, 14 Jan 2007 18:25:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H6EiB-0004AF-UF for emacs-devel@gnu.org; Sun, 14 Jan 2007 18:24:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H6EiA-00048g-Vs for emacs-devel@gnu.org; Sun, 14 Jan 2007 18:24:27 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H6EiA-00048X-Sb for emacs-devel@gnu.org; Sun, 14 Jan 2007 18:24:26 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H6EiA-0004M6-K8 for emacs-devel@gnu.org; Sun, 14 Jan 2007 18:24:26 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1H6EhZ-0007RS-M7; Sun, 14 Jan 2007 18:23:49 -0500 Original-To: Glenn Morris In-reply-to: (message from Glenn Morris on Tue, 09 Jan 2007 23:14:02 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:65211 Archived-At: Does anyone have the expertise to look for a cleaner version of this change? From: Glenn Morris To: emacs-devel@gnu.org Cc: rms@gnu.org, Andreas Schwab Subject: Re: add etc/PROBLEMS entry for building 32-bit exe on 64-bit system Date: Tue, 09 Jan 2007 23:14:02 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Actually, I don't know any more if I'm asking for a reasonable thing. Should I expect to be able to _compile_ 32-bit apps on an x86_64 system, or just _run_ them? The fact that almost none of the OS "devel" packages exist in 32-bit form suggests the latter. Glenn Morris wrote: > I imagine it's reasonable to expect configure to just Do The Right > Thing With some playing around, I find the following change enables me to just use configure --build=i386-linux-gnu to get the desired result. I don't know how correct/desirable it is though. Index: configure.in =================================================================== RCS file: /sources/emacs/emacs/configure.in,v retrieving revision 1.428 diff -c -c -w -r1.428 configure.in *** configure.in 3 Jan 2007 23:47:04 -0000 1.428 --- configure.in 10 Jan 2007 04:09:31 -0000 *************** *** 1486,1491 **** --- 1486,1523 ---- CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS" fi + ## Build a 32-bit version on x86_64 GNU/Linux? + case "${canonical}" in + i386-*linux-gnu* ) + case `$SHELL "$ac_aux_dir/config.guess"` in + x86_64-*-linux-gnu* ) + + x86_64_build_m32=yes + + save_CFLAGS="$CFLAGS" + CFLAGS="-m32 $CFLAGS" + AC_MSG_CHECKING([whether compiler understands -m32]) + AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) + AC_MSG_RESULT($has_option) + if test $has_option = yes; then + REAL_CFLAGS="-m32 $REAL_CFLAGS" + fi + CFLAGS="$save_CFLAGS" + unset has_option + unset save_CFLAGS + + save_LDFLAGS="$LDFLAGS" + LDFLAGS="-m32 $LDFLAGS" + AC_MSG_CHECKING([whether linker understands -m32]) + AC_LINK_IFELSE([main(){return 0;}], + [AC_MSG_RESULT(yes)], + LDFLAGS="$save_LDFLAGS" + [AC_MSG_RESULT(no)]) + unset save_LDFLAGS ;; + + esac ;; + esac + dnl For AC_FUNC_GETLOADAVG, at least: AC_CONFIG_LIBOBJ_DIR(src) *************** *** 1765,1770 **** --- 1797,1805 ---- if test "${x_libraries}" != NONE; then if test -n "${x_libraries}"; then + if test -n "${x86_64_build_m32}"; then + x_libraries=`echo ${x_libraries} | sed -e "s:/lib64:/lib:g"` + fi LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"` LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"` fi