From unknown Mon Jun 23 13:15:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12047: 24.1.50; configure fails on Gentoo FreeBSD Resent-From: Ulrich Mueller Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Jul 2012 23:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12047 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 12047@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13432579642003 (code B ref -1); Wed, 25 Jul 2012 23:13:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Jul 2012 23:12:44 +0000 Received: from localhost ([127.0.0.1]:39734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SuAl1-0000WG-Pu for submit@debbugs.gnu.org; Wed, 25 Jul 2012 19:12:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46296) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SuAky-0000W8-LX for submit@debbugs.gnu.org; Wed, 25 Jul 2012 19:12:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuAeN-0005pa-FT for submit@debbugs.gnu.org; Wed, 25 Jul 2012 19:05:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:57836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuAeN-0005pW-Bl for submit@debbugs.gnu.org; Wed, 25 Jul 2012 19:05:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuAeM-0007aH-1P for bug-gnu-emacs@gnu.org; Wed, 25 Jul 2012 19:05:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuAeI-0005oz-6T for bug-gnu-emacs@gnu.org; Wed, 25 Jul 2012 19:05:49 -0400 Received: from a1iwww1.kph.uni-mainz.de ([134.93.134.1]:58178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuAeH-0005oI-Fa for bug-gnu-emacs@gnu.org; Wed, 25 Jul 2012 19:05:45 -0400 Received: from a1i15.kph.uni-mainz.de (a1i15.kph.uni-mainz.de [134.93.134.92]) by a1iwww1.kph.uni-mainz.de (8.14.4/8.13.4) with ESMTP id q6PN5XTo009235 for ; Thu, 26 Jul 2012 01:05:33 +0200 Received: from a1i15.kph.uni-mainz.de (localhost [127.0.0.1]) by a1i15.kph.uni-mainz.de (8.14.5/8.14.2) with ESMTP id q6PN5WGB031668; Thu, 26 Jul 2012 01:05:32 +0200 Received: (from ulm@localhost) by a1i15.kph.uni-mainz.de (8.14.5/8.14.5/Submit) id q6PN5Wv8031664; Thu, 26 Jul 2012 01:05:32 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----cutting-here-may-damage-your-screen-surface----81848708----" Message-ID: <20496.31676.541743.480447@a1i15.kph.uni-mainz.de> Date: Thu, 26 Jul 2012 01:05:32 +0200 X-Mailer: VM 8.2.0b under 23.4.2 (x86_64-pc-linux-gnu) From: Ulrich Mueller X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) ------cutting-here-may-damage-your-screen-surface----81848708---- Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit Emacs from BZR (but also 24.1) fails on Gentoo FreeBSD 9.0 during configure: configure: error: Required file(s) not found: crtn.o crt1.o crti.o Try using the --with-crt-dir option. $ uname -a FreeBSD eunomia 9.0-Gentoo FreeBSD Gentoo 9.0 #0: Tue Jul 24 02:42:55 CEST 2012 root@:/usr/src/sys/amd64/compile/GENERIC amd64 The problem is that crt{1,i,n}.o (which are installed by freebsd-lib) are located in /usr/lib, whereas crt{begin,end}.o (installed by gcc) are in /usr/lib/gcc/x86_64-gentoo-freebsd9.0/4.5.3. Obviously, specifying a location with --with-crt-dir wouldn't help in this situation, because configure assumes that all crt*.o files are in the same directory. Attached patch fixes the problem for me. (Another question is why crtbegin.o and crtend.o are needed for linking on FreeBSD, in the first place? Emacs builds and runs here without apparent problems, even if linked without these files.) ------cutting-here-may-damage-your-screen-surface----81848708---- Content-Type: text/plain; name="emacs.patch" Content-Disposition: inline; filename="emacs.patch" Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by a1iwww1.kph.uni-mainz.de id q6PN5XTo009235 --- emacs-orig/ChangeLog +++ emacs/ChangeLog @@ -1,3 +1,10 @@ +2012-07-25 Ulrich M=C3=BCller + + * configure.in: Don't assume that crtbegin.o and crtend.o are in + the same directory as crt1.o. + (--with-crtbegin-dir): New option. + (CRTBEGIN_DIR): New output variable. + 2012-07-17 Dmitry Antipov =20 Fix toolkit configuration report. --- emacs-orig/src/ChangeLog +++ emacs/src/ChangeLog @@ -1,3 +1,7 @@ +2012-07-25 Ulrich M=C3=BCller + + * Makefile.in (CRTBEGIN_DIR): New variable. + 2012-07-25 Martin Rudalics =20 * frame.c (Fredirect_frame_focus): In doc-string don't mention --- emacs-orig/configure.ac +++ emacs/configure.ac @@ -212,6 +212,12 @@ The default is /usr/lib, or /usr/lib64 on some platforms.])]) CRT_DIR=3D"${with_crt_dir}" =20 +CRTBEGIN_DIR=3D$CRT_DIR +AC_ARG_WITH([crtbegin-dir], +[AS_HELP_STRING([--with-crtbegin-dir=3DDIR], +[directory containing crtbegin.o and crtend.o; defaults to crt-dir])]) +CRTBEGIN_DIR=3D"${with_crtbegin_dir}" + AC_ARG_WITH(gameuser,dnl [AS_HELP_STRING([--with-gameuser=3DUSER],[user for shared game score fil= es])]) test "X${with_gameuser}" !=3D X && test "${with_gameuser}" !=3D yes \ @@ -987,8 +993,8 @@ START_FILES=3D'pre-crt0.o' ;; freebsd ) - LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.= o' - START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_= DIR)/crtbegin.o' + LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRTBEGIN_DIR)/crtend.o $(CRT_DIR)/= crtn.o' + START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRTB= EGIN_DIR)/crtbegin.o' SYSTEM_TYPE=3Dberkeley-unix ;; gnu-linux | gnu-kfreebsd ) @@ -1001,8 +1007,8 @@ ;; dnl NB this may be adjusted below. netbsd | openbsd ) - LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRT_DIR)/crtend.o' - START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o' + LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRTBEGIN_DIR)/crtend.o' + START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt0.o $(CRTBEGIN_DIR)/crtbegin= .o' SYSTEM_TYPE=3Dberkeley-unix ;; =20 @@ -1019,14 +1025,17 @@ =20 dnl Not all platforms use crtn.o files. Check if the current one does. crt_files=3D +crtbegin_files=3D =20 for file in x $LIB_STANDARD $START_FILES; do case "$file" in *CRT_DIR*) crt_files=3D"$crt_files `echo $file | sed -e 's|.*/||'`" = ;; + *CRTBEGIN_DIR*) + crtbegin_files=3D"$crtbegin_files `echo $file | sed -e 's|.*/||'`"= ;; esac done =20 -if test "x$crt_files" !=3D x; then +if test "x$crt_files" !=3D x || test "x$crtbegin_files" !=3D x; then =20 ## If user specified a crt-dir, use that unconditionally. crt_gcc=3Dno @@ -1058,6 +1067,12 @@ =20 fi # CRT_DIR =3D "" =20 + crtbegin_gcc=3Dno + if test "X$CRTBEGIN_DIR" =3D X; then + CRTBEGIN_DIR=3D$CRT_DIR + crtbegin_gcc=3D$crt_gcc + fi + crt_missing=3D =20 for file in $crt_files; do @@ -1082,13 +1097,26 @@ test -e $CRT_DIR/$file || crt_missing=3D"$crt_missing $file" done # $crt_files =20 + dnl Same as above, but for crtbegin.o and crtend.o. + for file in $crtbegin_files; do + if test $crtbegin_gcc =3D yes && test ! -e "$CRTBEGIN_DIR/$file"; th= en + crt_file=3D`$CC --print-file-name=3D$file 2>/dev/null` + case "$crt_file" in + */*) CRTBEGIN_DIR=3D`AS_DIRNAME(["$crt_file"])` ;; + esac + fi + crtbegin_gcc=3Dno + test -e "$CRTBEGIN_DIR/$file" || crt_missing=3D"$crt_missing $file" + done + test "x$crt_missing" =3D x || \ AC_MSG_ERROR([Required file(s) not found:$crt_missing -Try using the --with-crt-dir option.]) +Try using the --with-crt-dir or --with-crtbegin-dir option.]) =20 -fi # crt_files !=3D "" +fi # crt_files !=3D "" || crtbegin_files !=3D= "" =20 AC_SUBST(CRT_DIR) +AC_SUBST(CRTBEGIN_DIR) =20 case $opsys in netbsd | openbsd ) @@ -1097,8 +1125,8 @@ test -f $CRT_DIR/crtn.o || \ AC_MSG_ERROR([Required file not found: crtn.o]) =20 - LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/c= rtn.o' - START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(= CRT_DIR)/crtbegin.o' + LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRTBEGIN_DIR)/crtend.o $(CRT_D= IR)/crtn.o' + START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(= CRTBEGIN_DIR)/crtbegin.o' fi ;; esac --- emacs-orig/src/Makefile.in +++ emacs/src/Makefile.in @@ -126,6 +126,7 @@ LIB_GCC=3D@LIB_GCC@ =20 CRT_DIR=3D@CRT_DIR@ +CRTBEGIN_DIR=3D@CRTBEGIN_DIR@ ## May use $CRT_DIR. LIB_STANDARD=3D@LIB_STANDARD@ START_FILES =3D @START_FILES@ ------cutting-here-may-damage-your-screen-surface----81848708------ From unknown Mon Jun 23 13:15:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12047: 24.1.50; configure fails on Gentoo FreeBSD Resent-From: Ulrich Mueller Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Jul 2012 07:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12047 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 12047@debbugs.gnu.org Received: via spool by 12047-submit@debbugs.gnu.org id=B12047.134337502823185 (code B ref 12047); Fri, 27 Jul 2012 07:44:02 +0000 Received: (at 12047) by debbugs.gnu.org; 27 Jul 2012 07:43:48 +0000 Received: from localhost ([127.0.0.1]:42791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SufD9-00061t-KJ for submit@debbugs.gnu.org; Fri, 27 Jul 2012 03:43:47 -0400 Received: from a1iwww1.kph.uni-mainz.de ([134.93.134.1]:59096) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SufD7-00061h-7h for 12047@debbugs.gnu.org; Fri, 27 Jul 2012 03:43:46 -0400 Received: from a1i15.kph.uni-mainz.de (a1i15.kph.uni-mainz.de [134.93.134.92]) by a1iwww1.kph.uni-mainz.de (8.14.4/8.13.4) with ESMTP id q6R7am8i028858 for <12047@debbugs.gnu.org>; Fri, 27 Jul 2012 09:36:48 +0200 Received: from a1i15.kph.uni-mainz.de (localhost [127.0.0.1]) by a1i15.kph.uni-mainz.de (8.14.5/8.14.2) with ESMTP id q6R7am1V019528; Fri, 27 Jul 2012 09:36:48 +0200 Received: (from ulm@localhost) by a1i15.kph.uni-mainz.de (8.14.5/8.14.5/Submit) id q6R7amlF019526; Fri, 27 Jul 2012 09:36:48 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----cutting-here-may-damage-your-screen-surface----17682809----" Message-ID: <20498.17680.547196.931475@a1i15.kph.uni-mainz.de> Date: Fri, 27 Jul 2012 09:36:48 +0200 In-Reply-To: <20496.31676.541743.480447@a1i15.kph.uni-mainz.de> References: <20496.31676.541743.480447@a1i15.kph.uni-mainz.de> X-Mailer: VM 8.2.0b under 23.4.2 (x86_64-pc-linux-gnu) From: Ulrich Mueller X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) ------cutting-here-may-damage-your-screen-surface----17682809---- Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit > (Another question is why crtbegin.o and crtend.o are needed for > linking on FreeBSD, in the first place? Emacs builds and runs here > without apparent problems, even if linked without these files.) Coming back to this. After talking to the Gentoo BSD team, I've now dropped crtbegin.o and crtend.o from linking on FreeBSD in the Gentoo package. See attached patch. Tested on Gentoo FreeBSD 9.0 and on (vanilla) FreeBSD 7.0. It builds and runs just fine. ------cutting-here-may-damage-your-screen-surface----17682809---- Content-Type: text/plain; name="emacs.patch" Content-Disposition: inline; filename="emacs.patch" Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by a1iwww1.kph.uni-mainz.de id q6R7am8i028858 --- emacs-orig/ChangeLog +++ emacs/ChangeLog @@ -1,3 +1,8 @@ +2012-07-27 Ulrich M=C3=BCller + + * configure.ac (LIB_STANDARD, START_FILES): On FreeBSD, don't + include crtbegin.o and crtend.o in the link (Bug#12047). + 2012-07-17 Dmitry Antipov =20 Fix toolkit configuration report. --- emacs-orig/configure.ac +++ emacs/configure.ac @@ -987,8 +987,8 @@ START_FILES=3D'pre-crt0.o' ;; freebsd ) - LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.= o' - START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_= DIR)/crtbegin.o' + LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRT_DIR)/crtn.o' + START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o' SYSTEM_TYPE=3Dberkeley-unix ;; gnu-linux | gnu-kfreebsd ) ------cutting-here-may-damage-your-screen-surface----17682809------ From unknown Mon Jun 23 13:15:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12047: 24.1.50; configure fails on Gentoo FreeBSD Resent-From: Ulrich Mueller Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Aug 2012 00:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12047 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 12047@debbugs.gnu.org Received: via spool by 12047-submit@debbugs.gnu.org id=B12047.13437792542117 (code B ref 12047); Wed, 01 Aug 2012 00:01:02 +0000 Received: (at 12047) by debbugs.gnu.org; 1 Aug 2012 00:00:54 +0000 Received: from localhost ([127.0.0.1]:53399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SwMMv-0000Y3-Ev for submit@debbugs.gnu.org; Tue, 31 Jul 2012 20:00:53 -0400 Received: from a1iwww1.kph.uni-mainz.de ([134.93.134.1]:45764) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SwMMt-0000Xu-44 for 12047@debbugs.gnu.org; Tue, 31 Jul 2012 20:00:52 -0400 Received: from a1i15.kph.uni-mainz.de (a1i15.kph.uni-mainz.de [134.93.134.92]) by a1iwww1.kph.uni-mainz.de (8.14.4/8.13.4) with ESMTP id q6VNrSjr028917 for <12047@debbugs.gnu.org>; Wed, 1 Aug 2012 01:53:28 +0200 Received: from a1i15.kph.uni-mainz.de (localhost [127.0.0.1]) by a1i15.kph.uni-mainz.de (8.14.5/8.14.2) with ESMTP id q6VNrRUX030183; Wed, 1 Aug 2012 01:53:27 +0200 Received: (from ulm@localhost) by a1i15.kph.uni-mainz.de (8.14.5/8.14.5/Submit) id q6VNrRQS030181; Wed, 1 Aug 2012 01:53:27 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20504.28663.477639.347313@a1i15.kph.uni-mainz.de> Date: Wed, 1 Aug 2012 01:53:27 +0200 In-Reply-To: <20498.17680.547196.931475@a1i15.kph.uni-mainz.de> References: <20496.31676.541743.480447@a1i15.kph.uni-mainz.de> <20498.17680.547196.931475@a1i15.kph.uni-mainz.de> X-Mailer: VM 8.2.0b under 23.4.2 (x86_64-pc-linux-gnu) From: Ulrich Mueller X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Small update: I've had the chance to test it also on an ancient FreeBSD version (4.2, released in November 2000). Emacs 24.1 builds and runs fine without being linked to crt{begin,end}.o. (In contrast, on recent OpenBSD 5.1 these files are needed. Omitting crt{begin,end}.o causes linking to fail with an "undefined reference to __init".) From unknown Mon Jun 23 13:15:23 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ulrich Mueller Subject: bug#12047: closed (Re: bug#12047: 24.1.50; configure fails on Gentoo FreeBSD) Message-ID: References: <20496.31676.541743.480447@a1i15.kph.uni-mainz.de> X-Gnu-PR-Message: they-closed 12047 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 12047@debbugs.gnu.org Date: Wed, 01 Aug 2012 07:29:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1343806142-8311-1" This is a multi-part message in MIME format... ------------=_1343806142-8311-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #12047: 24.1.50; configure fails on Gentoo FreeBSD which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 12047@debbugs.gnu.org. --=20 12047: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D12047 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1343806142-8311-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 12047-done) by debbugs.gnu.org; 1 Aug 2012 07:28:39 +0000 Received: from localhost ([127.0.0.1]:53832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SwTME-00029Q-4Q for submit@debbugs.gnu.org; Wed, 01 Aug 2012 03:28:39 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:45193) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SwTMB-00029I-Sd for 12047-done@debbugs.gnu.org; Wed, 01 Aug 2012 03:28:36 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1SwTF1-0002at-Sk; Wed, 01 Aug 2012 03:21:11 -0400 From: Glenn Morris To: 12047-done@debbugs.gnu.org Subject: Re: bug#12047: 24.1.50; configure fails on Gentoo FreeBSD References: <20496.31676.541743.480447@a1i15.kph.uni-mainz.de> <20498.17680.547196.931475@a1i15.kph.uni-mainz.de> <20504.28663.477639.347313@a1i15.kph.uni-mainz.de> X-Spook: BATF Semtex FSF bootleg Mossad Blowpipe ammunition X-Ran: *mH:KLd(%hrXUFY*`5$s*7xDj-l`qW{/Ydr-xkbo=-bNu!fNT|lEMYA]GhY]=AnD$kJVA( X-Hue: yellow X-Debbugs-No-Ack: yes X-Attribution: GM Date: Wed, 01 Aug 2012 03:21:11 -0400 In-Reply-To: <20504.28663.477639.347313@a1i15.kph.uni-mainz.de> (Ulrich Mueller's message of "Wed, 1 Aug 2012 01:53:27 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 12047-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Version: 24.2 Thank you; applied. ------------=_1343806142-8311-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 25 Jul 2012 23:12:44 +0000 Received: from localhost ([127.0.0.1]:39734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SuAl1-0000WG-Pu for submit@debbugs.gnu.org; Wed, 25 Jul 2012 19:12:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46296) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SuAky-0000W8-LX for submit@debbugs.gnu.org; Wed, 25 Jul 2012 19:12:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuAeN-0005pa-FT for submit@debbugs.gnu.org; Wed, 25 Jul 2012 19:05:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:57836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuAeN-0005pW-Bl for submit@debbugs.gnu.org; Wed, 25 Jul 2012 19:05:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuAeM-0007aH-1P for bug-gnu-emacs@gnu.org; Wed, 25 Jul 2012 19:05:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuAeI-0005oz-6T for bug-gnu-emacs@gnu.org; Wed, 25 Jul 2012 19:05:49 -0400 Received: from a1iwww1.kph.uni-mainz.de ([134.93.134.1]:58178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuAeH-0005oI-Fa for bug-gnu-emacs@gnu.org; Wed, 25 Jul 2012 19:05:45 -0400 Received: from a1i15.kph.uni-mainz.de (a1i15.kph.uni-mainz.de [134.93.134.92]) by a1iwww1.kph.uni-mainz.de (8.14.4/8.13.4) with ESMTP id q6PN5XTo009235 for ; Thu, 26 Jul 2012 01:05:33 +0200 Received: from a1i15.kph.uni-mainz.de (localhost [127.0.0.1]) by a1i15.kph.uni-mainz.de (8.14.5/8.14.2) with ESMTP id q6PN5WGB031668; Thu, 26 Jul 2012 01:05:32 +0200 Received: (from ulm@localhost) by a1i15.kph.uni-mainz.de (8.14.5/8.14.5/Submit) id q6PN5Wv8031664; Thu, 26 Jul 2012 01:05:32 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----cutting-here-may-damage-your-screen-surface----81848708----" Message-ID: <20496.31676.541743.480447@a1i15.kph.uni-mainz.de> Date: Thu, 26 Jul 2012 01:05:32 +0200 To: bug-gnu-emacs@gnu.org Subject: 24.1.50; configure fails on Gentoo FreeBSD X-Mailer: VM 8.2.0b under 23.4.2 (x86_64-pc-linux-gnu) From: Ulrich Mueller X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) ------cutting-here-may-damage-your-screen-surface----81848708---- Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit Emacs from BZR (but also 24.1) fails on Gentoo FreeBSD 9.0 during configure: configure: error: Required file(s) not found: crtn.o crt1.o crti.o Try using the --with-crt-dir option. $ uname -a FreeBSD eunomia 9.0-Gentoo FreeBSD Gentoo 9.0 #0: Tue Jul 24 02:42:55 CEST 2012 root@:/usr/src/sys/amd64/compile/GENERIC amd64 The problem is that crt{1,i,n}.o (which are installed by freebsd-lib) are located in /usr/lib, whereas crt{begin,end}.o (installed by gcc) are in /usr/lib/gcc/x86_64-gentoo-freebsd9.0/4.5.3. Obviously, specifying a location with --with-crt-dir wouldn't help in this situation, because configure assumes that all crt*.o files are in the same directory. Attached patch fixes the problem for me. (Another question is why crtbegin.o and crtend.o are needed for linking on FreeBSD, in the first place? Emacs builds and runs here without apparent problems, even if linked without these files.) ------cutting-here-may-damage-your-screen-surface----81848708---- Content-Type: text/plain; name="emacs.patch" Content-Disposition: inline; filename="emacs.patch" Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by a1iwww1.kph.uni-mainz.de id q6PN5XTo009235 --- emacs-orig/ChangeLog +++ emacs/ChangeLog @@ -1,3 +1,10 @@ +2012-07-25 Ulrich M=C3=BCller + + * configure.in: Don't assume that crtbegin.o and crtend.o are in + the same directory as crt1.o. + (--with-crtbegin-dir): New option. + (CRTBEGIN_DIR): New output variable. + 2012-07-17 Dmitry Antipov =20 Fix toolkit configuration report. --- emacs-orig/src/ChangeLog +++ emacs/src/ChangeLog @@ -1,3 +1,7 @@ +2012-07-25 Ulrich M=C3=BCller + + * Makefile.in (CRTBEGIN_DIR): New variable. + 2012-07-25 Martin Rudalics =20 * frame.c (Fredirect_frame_focus): In doc-string don't mention --- emacs-orig/configure.ac +++ emacs/configure.ac @@ -212,6 +212,12 @@ The default is /usr/lib, or /usr/lib64 on some platforms.])]) CRT_DIR=3D"${with_crt_dir}" =20 +CRTBEGIN_DIR=3D$CRT_DIR +AC_ARG_WITH([crtbegin-dir], +[AS_HELP_STRING([--with-crtbegin-dir=3DDIR], +[directory containing crtbegin.o and crtend.o; defaults to crt-dir])]) +CRTBEGIN_DIR=3D"${with_crtbegin_dir}" + AC_ARG_WITH(gameuser,dnl [AS_HELP_STRING([--with-gameuser=3DUSER],[user for shared game score fil= es])]) test "X${with_gameuser}" !=3D X && test "${with_gameuser}" !=3D yes \ @@ -987,8 +993,8 @@ START_FILES=3D'pre-crt0.o' ;; freebsd ) - LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.= o' - START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_= DIR)/crtbegin.o' + LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRTBEGIN_DIR)/crtend.o $(CRT_DIR)/= crtn.o' + START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRTB= EGIN_DIR)/crtbegin.o' SYSTEM_TYPE=3Dberkeley-unix ;; gnu-linux | gnu-kfreebsd ) @@ -1001,8 +1007,8 @@ ;; dnl NB this may be adjusted below. netbsd | openbsd ) - LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRT_DIR)/crtend.o' - START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o' + LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRTBEGIN_DIR)/crtend.o' + START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt0.o $(CRTBEGIN_DIR)/crtbegin= .o' SYSTEM_TYPE=3Dberkeley-unix ;; =20 @@ -1019,14 +1025,17 @@ =20 dnl Not all platforms use crtn.o files. Check if the current one does. crt_files=3D +crtbegin_files=3D =20 for file in x $LIB_STANDARD $START_FILES; do case "$file" in *CRT_DIR*) crt_files=3D"$crt_files `echo $file | sed -e 's|.*/||'`" = ;; + *CRTBEGIN_DIR*) + crtbegin_files=3D"$crtbegin_files `echo $file | sed -e 's|.*/||'`"= ;; esac done =20 -if test "x$crt_files" !=3D x; then +if test "x$crt_files" !=3D x || test "x$crtbegin_files" !=3D x; then =20 ## If user specified a crt-dir, use that unconditionally. crt_gcc=3Dno @@ -1058,6 +1067,12 @@ =20 fi # CRT_DIR =3D "" =20 + crtbegin_gcc=3Dno + if test "X$CRTBEGIN_DIR" =3D X; then + CRTBEGIN_DIR=3D$CRT_DIR + crtbegin_gcc=3D$crt_gcc + fi + crt_missing=3D =20 for file in $crt_files; do @@ -1082,13 +1097,26 @@ test -e $CRT_DIR/$file || crt_missing=3D"$crt_missing $file" done # $crt_files =20 + dnl Same as above, but for crtbegin.o and crtend.o. + for file in $crtbegin_files; do + if test $crtbegin_gcc =3D yes && test ! -e "$CRTBEGIN_DIR/$file"; th= en + crt_file=3D`$CC --print-file-name=3D$file 2>/dev/null` + case "$crt_file" in + */*) CRTBEGIN_DIR=3D`AS_DIRNAME(["$crt_file"])` ;; + esac + fi + crtbegin_gcc=3Dno + test -e "$CRTBEGIN_DIR/$file" || crt_missing=3D"$crt_missing $file" + done + test "x$crt_missing" =3D x || \ AC_MSG_ERROR([Required file(s) not found:$crt_missing -Try using the --with-crt-dir option.]) +Try using the --with-crt-dir or --with-crtbegin-dir option.]) =20 -fi # crt_files !=3D "" +fi # crt_files !=3D "" || crtbegin_files !=3D= "" =20 AC_SUBST(CRT_DIR) +AC_SUBST(CRTBEGIN_DIR) =20 case $opsys in netbsd | openbsd ) @@ -1097,8 +1125,8 @@ test -f $CRT_DIR/crtn.o || \ AC_MSG_ERROR([Required file not found: crtn.o]) =20 - LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/c= rtn.o' - START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(= CRT_DIR)/crtbegin.o' + LIB_STANDARD=3D'-lgcc -lc -lgcc $(CRTBEGIN_DIR)/crtend.o $(CRT_D= IR)/crtn.o' + START_FILES=3D'pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(= CRTBEGIN_DIR)/crtbegin.o' fi ;; esac --- emacs-orig/src/Makefile.in +++ emacs/src/Makefile.in @@ -126,6 +126,7 @@ LIB_GCC=3D@LIB_GCC@ =20 CRT_DIR=3D@CRT_DIR@ +CRTBEGIN_DIR=3D@CRTBEGIN_DIR@ ## May use $CRT_DIR. LIB_STANDARD=3D@LIB_STANDARD@ START_FILES =3D @START_FILES@ ------cutting-here-may-damage-your-screen-surface----81848708------ ------------=_1343806142-8311-1--