From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: add etc/PROBLEMS entry for building 32-bit exe on 64-bit system Date: Tue, 09 Jan 2007 23:14:02 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1168402493 24351 80.91.229.12 (10 Jan 2007 04:14:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 Jan 2007 04:14:53 +0000 (UTC) Cc: Andreas Schwab , rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 10 05:14:51 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 1H4UrO-0002Ep-43 for ged-emacs-devel@m.gmane.org; Wed, 10 Jan 2007 05:14:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H4UrN-0006qd-Oi for ged-emacs-devel@m.gmane.org; Tue, 09 Jan 2007 23:14:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H4UrC-0006p4-FM for emacs-devel@gnu.org; Tue, 09 Jan 2007 23:14:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H4UrB-0006oV-VY for emacs-devel@gnu.org; Tue, 09 Jan 2007 23:14:34 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H4UrB-0006oK-Oa for emacs-devel@gnu.org; Tue, 09 Jan 2007 23:14:33 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H4UrB-0005Mi-IQ for emacs-devel@gnu.org; Tue, 09 Jan 2007 23:14:33 -0500 Original-Received: from [127.0.0.1] (helo=localhost) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1H4Uqh-0003Pr-7B; Tue, 09 Jan 2007 23:14:03 -0500 Original-To: emacs-devel@gnu.org X-Spook: bullion Lon Horiuchi USDOJ Manfurov Kh-11 credit card X-Ran: X^aGB#Ck[de2.cNaIxsomL]|(W\b$>XZ?.sJps0hS%)y/_8imjuE-7,TAnAV"7Pow!pU`; X-Hue: yellow X-Attribution: GM User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) 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:65105 Archived-At: 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