From geb-bug-gnu-emacs@m.gmane.org Tue Feb 10 00:00:21 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 10 Feb 2009 08:00:21 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1A80DAq004224 for ; Tue, 10 Feb 2009 00:00:15 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LWnXQ-0004mK-Ko for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 03:00:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LWnXN-0004l8-E6 for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 03:00:10 -0500 Received: from [199.232.76.173] (port=47977 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWnXM-0004l4-Nu for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 03:00:08 -0500 Received: from mx20.gnu.org ([199.232.41.8]:26311) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LWnXM-0000iL-1H for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 03:00:08 -0500 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LWnXK-00064H-QN for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 03:00:06 -0500 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1LWnXH-0001VD-1U for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 08:00:03 +0000 Received: from 213.91.219.2 ([213.91.219.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Feb 2009 08:00:03 +0000 Received: from yavor by 213.91.219.2 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Feb 2009 08:00:03 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Yavor Doganov Subject: Re: Failed to build emacs 23.0.90 on Ubuntu 8.10 (x86_64) Date: Tue, 10 Feb 2009 09:55:18 +0200 Organization: The GNU Emacs Church (Bulgarian eparchy) Lines: 45 Message-ID: <87ljse7ml5.GNU's_Not_Unix!%yavor@gnu.org> References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 213.91.219.2 In-Reply-To: Mail-Followup-To: bug-gnu-emacs@gnu.org, yavor@gnu.org User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.2 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI) X-Jabber-ID: doganov@jabber.minus273.org Sender: news X-detected-kernel: by mx20.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Thank you for trying to build the GNUstep port. I've been holding these changes for far too long. (I wonder why this message didn't get a bug number assigned? Perhaps because it was posted to the newsgroup first...) 2009-02-10 Yavor Doganov (tiny change) * nsterm.m: Include . * nsfns.m (ns_appkit_version_int): Fix typo in the version macro. Index: src/nsfns.m =================================================================== RCS file: /sources/emacs/emacs/src/nsfns.m,v retrieving revision 1.36 diff -u -r1.36 nsfns.m --- src/nsfns.m 23 Jan 2009 09:58:03 -0000 1.36 +++ src/nsfns.m 10 Feb 2009 07:47:51 -0000 @@ -974,7 +974,7 @@ ns_appkit_version_int () { #ifdef NS_IMPL_GNUSTEP - return GNUSTEP_GUI_MAJOR_VERSION * 100 + GNUSTEP_GNU_MINOR_VERSION; + return GNUSTEP_GUI_MAJOR_VERSION * 100 + GNUSTEP_GUI_MINOR_VERSION; #elif defined(NS_IMPL_COCOA) return (int)NSAppKitVersionNumber; #endif Index: src/nsterm.m =================================================================== RCS file: /sources/emacs/emacs/src/nsterm.m,v retrieving revision 1.58 diff -u -r1.58 nsterm.m --- src/nsterm.m 7 Feb 2009 11:04:07 -0000 1.58 +++ src/nsterm.m 10 Feb 2009 07:47:54 -0000 @@ -30,6 +30,7 @@ #include "config.h" #include +#include #include #include #include From yavor@gnu.org Tue Feb 10 00:19:22 2009 Received: (at control) by emacsbugs.donarmstrong.com; 10 Feb 2009 08:19:22 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: * X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=1.1 required=4.0 tests=MURPHY_DRUGS_REL8,ONEWORD, RDNS_NONE,VALID_BTS_CONTROL autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from southway-varna.com ([213.91.219.2]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1A8JInA009807 for ; Tue, 10 Feb 2009 00:19:20 -0800 Received: from keel.southway-varna.com ([192.168.0.2]) by southway-varna.com with esmtp (Exim 4.63) (envelope-from ) id 1LWnps-0005vg-LM for control@emacsbugs.donarmstrong.com; Tue, 10 Feb 2009 10:19:17 +0200 Received: from localhost ([127.0.0.1] helo=keel.southway-varna.com) by keel.southway-varna.com with esmtp (Exim 4.69) (envelope-from ) id 1LWnps-0002IN-Jd for control@emacsbugs.donarmstrong.com; Tue, 10 Feb 2009 10:19:16 +0200 Date: Tue, 10 Feb 2009 10:19:16 +0200 Message-ID: <87k57y7lh7.GNU's_Not_Unix!%yavor@gnu.org> From: Yavor Doganov To: control@debbugs.gnu.org User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.2 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI) Organization: The GNU Emacs Church (Bulgarian eparchy) X-Jabber-ID: doganov@jabber.minus273.org MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 192.168.0.2 X-SA-Exim-Mail-From: yavor@gnu.org Subject: Reassigning X-SA-Exim-Version: 4.2.1 (built Tue, 09 Jan 2007 17:23:22 +0000) X-SA-Exim-Scanned: Yes (on southway-varna.com) reassign 2264 emacs,ns tags 2264 patch thanks From monnier@iro.umontreal.ca Tue Feb 10 17:53:05 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 11 Feb 2009 01:53:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.5 required=4.0 tests=HAS_BUG_NUMBER,XIRONPORT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1B1r2vO004091 for ; Tue, 10 Feb 2009 17:53:03 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LX4He-0003Mr-Do for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 20:53:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LX4Hc-0003Mf-V6 for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 20:53:02 -0500 Received: from [199.232.76.173] (port=38529 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LX4Hc-0003Mc-Tc for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 20:53:00 -0500 Received: from ironport2-out.pppoe.ca ([206.248.154.182]:40641 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LX4Hb-0002Te-W0; Tue, 10 Feb 2009 20:53:00 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArEEAIi+kUlFxIvi/2dsb2JhbACBbtFwhBoGgyM X-IronPort-AV: E=Sophos;i="4.38,188,1233550800"; d="scan'208";a="33695083" Received: from 69-196-139-226.dsl.teksavvy.com (HELO pastel.home) ([69.196.139.226]) by ironport2-out.teksavvy.com with ESMTP; 10 Feb 2009 20:52:59 -0500 Received: by pastel.home (Postfix, from userid 20848) id 48B757FE6; Tue, 10 Feb 2009 20:52:59 -0500 (EST) From: Stefan Monnier To: bug-gnu-emacs@gnu.org Cc: yavor@gnu.org Subject: Re: bug#2264: Failed to build emacs 23.0.90 on Ubuntu 8.10 (x86_64) Message-ID: References: <87ljse7ml5.GNU's_Not_Unix!%yavor@gnu.org> Date: Tue, 10 Feb 2009 20:52:59 -0500 In-Reply-To: <87ljse7ml5.GNU's_Not_Unix!%yavor@gnu.org> (Yavor Doganov's message of "Tue, 10 Feb 2009 09:55:18 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. > Thank you for trying to build the GNUstep port. I've been holding > these changes for far too long. Thank you. It looks right. But I see that you already have 6 "tiny changes" installed, so this is becoming significant. We'll need you to sign copyright papers before we can install this contribution. Stefan From adrian.b.robert@gmail.com Fri Mar 6 07:38:20 2009 Received: (at 2264) by emacsbugs.donarmstrong.com; 6 Mar 2009 15:38:20 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-ew0-f176.google.com (mail-ew0-f176.google.com [209.85.219.176]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n26FcH0A019641 for <2264@emacsbugs.donarmstrong.com>; Fri, 6 Mar 2009 07:38:18 -0800 Received: by ewy24 with SMTP id 24so236397ewy.1 for <2264@emacsbugs.donarmstrong.com>; Fri, 06 Mar 2009 07:38:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:mime-version:content-type :message-id:cc:content-transfer-encoding:from:subject:date:to :x-mailer; bh=i9uBPCspJBK9oiJNKK68VMf15nfRJFTmh2k7XuINWf4=; b=JMhChBBfOT3LG0DpqU5aL1Oc5nwKxpPSnZzkNaK5beDCLHAjeKiDJhBe5wUWaWR5EI qGH5MYAzZN0Il/Hy6TnGpBm23kPqNDJSvdDM9yXT4IZbOaKCPu1JchDiKuW0DxYcZgpq dyhbrNjXlPVwHspParAFXEt1jt0QE1PfjnIzc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:content-type:message-id:cc:content-transfer-encoding :from:subject:date:to:x-mailer; b=hQkDz69a3QMxbo0zDTZqH+FLclFaNWmW/waVuhwgDLLm7Ijd1bHFEMBaKKrogdlLUy QXK+/FaCJobcuP2fyinyNZbaIw3uuqrnfs8RrRyRnqFBLE1s0c/PiP7v2xjqcCwkNH1O jLaf3yWdYD2kJ4tIBfwWz8xhi0Q9dPhD6IP5c= Received: by 10.216.28.209 with SMTP id g59mr1278322wea.96.1236353891391; Fri, 06 Mar 2009 07:38:11 -0800 (PST) Received: from ?88.194.195.100? (gprs-prointernet-ffc3c200-100.dhcp.inet.fi [88.194.195.100]) by mx.google.com with ESMTPS id h6sm2460768nfh.55.2009.03.06.07.38.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 06 Mar 2009 07:38:10 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <53306724-C4E4-4E8B-BB18-9FAB4CE5EA9A@gmail.com> Cc: Yavor Doganov Content-Transfer-Encoding: 7bit From: Adrian Robert Subject: Re: Failed to build emacs 23.0.90 on Ubuntu 8.10 (x86_64) Date: Fri, 6 Mar 2009 17:38:48 +0200 To: 2264@debbugs.gnu.org X-Mailer: Apple Mail (2.753.1) Hi, I've committed the fix to the typo in nsfns.m under my own name for now, until you can get your papers in. (It was my typo, so I assume I'm allowed to fix it. ;-) Regarding the signal.h include in nsterm, can you provide some background or a mailing list archive link as to why it is needed? Should I put it under some #ifdefs, at least NS_IMPL_GNUSTEP but possibly more? thanks, Adrian From yavor@gnu.org Fri Mar 6 09:27:26 2009 Received: (at 2264) by emacsbugs.donarmstrong.com; 6 Mar 2009 17:27:26 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from f7.net (server1.f7.net [64.34.169.74]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n26HRLuB015843 for <2264@emacsbugs.donarmstrong.com>; Fri, 6 Mar 2009 09:27:23 -0800 X-Envelope-From: yavor@gnu.org X-Envelope-To: 2264@debbugs.gnu.org Received: from yavor.doganov.org (92_245.btc-net.bg [213.91.245.92] (may be forged)) by f7.net (8.11.7-20030920/8.11.7) with ESMTP id n26HR9v14507; Fri, 6 Mar 2009 11:27:10 -0600 Received: from gana.yavor.doganov.org ([192.168.0.5]) by yavor.doganov.org with esmtp (Exim 4.69) (envelope-from ) id 1LfdpE-0000Rx-5d; Fri, 06 Mar 2009 19:27:09 +0200 Received: from localhost ([127.0.0.1] helo=gana.yavor.doganov.org) by gana.yavor.doganov.org with esmtp (Exim 4.69) (envelope-from ) id 1LfdpE-0000yh-10; Fri, 06 Mar 2009 19:27:08 +0200 Date: Fri, 06 Mar 2009 19:27:08 +0200 Message-ID: <871vta8sur.GNU's_Not_Unix!%yavor@gnu.org> From: Yavor Doganov To: Adrian Robert Cc: 2264@debbugs.gnu.org, Yavor Doganov In-Reply-To: <53306724-C4E4-4E8B-BB18-9FAB4CE5EA9A@gmail.com> References: <53306724-C4E4-4E8B-BB18-9FAB4CE5EA9A@gmail.com> Mail-Followup-To: Adrian Robert , 2264@debbugs.gnu.org, Yavor Doganov User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.3 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI) Organization: The GNU Emacs Church (Bulgarian eparchy) X-Jabber-ID: doganov@jabber.minus273.org MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 192.168.0.5 X-SA-Exim-Mail-From: yavor@gnu.org Subject: Re: Failed to build emacs 23.0.90 on Ubuntu 8.10 (x86_64) X-SA-Exim-Version: 4.2.1 (built Wed, 25 Jun 2008 17:14:11 +0000) X-SA-Exim-Scanned: Yes (on yavor.doganov.org) Adrian Robert wrote: > > I've committed the fix to the typo in nsfns.m under my own name for > now, until you can get your papers in. (It was my typo, so I assume > I'm allowed to fix it. ;-) Sure, thanks very much. > Regarding the signal.h include in nsterm, can you provide some > background or a mailing list archive link as to why it is needed? This is where the signal names are defined on glibc-based systems: ,---- (libc)Standard Signals ---- | This section lists the names for various standard kinds of signals and | describes what kind of event they mean. Each signal name is a macro | which stands for a positive integer--the "signal number" for that kind | of signal. Your programs should never make assumptions about the | numeric code for a particular kind of signal, but rather refer to them | always by the names defined here. This is because the number for a | given kind of signal can vary from system to system, but the meanings of | the names are standardized and fairly uniform. | | The signal names are defined in the header file `signal.h'. `---- > Should I put it under some #ifdefs, at least NS_IMPL_GNUSTEP but > possibly more? I'm fairly certain that this is needed on all GNU variants (I get the same failure on GNU/kFreeBSD, for example). However, GNUstep works on other systems (*BSD, Solaris, etc.) so maybe there unistd.h is sufficient (or not). If it causes problems on MacOS, then of course include it conditionally. Maybe someone more knowledgable will be able to comment. From adrian.b.robert@gmail.com Fri Mar 6 11:05:15 2009 Received: (at 2264-done) by emacsbugs.donarmstrong.com; 6 Mar 2009 19:05:15 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.189]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n26J5BLg008952 for <2264-done@emacsbugs.donarmstrong.com>; Fri, 6 Mar 2009 11:05:13 -0800 Received: by nf-out-0910.google.com with SMTP id d3so64550nfc.31 for <2264-done@emacsbugs.donarmstrong.com>; Fri, 06 Mar 2009 11:05:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:in-reply-to:references :mime-version:content-type:message-id:cc:content-transfer-encoding :from:subject:date:to:x-mailer; bh=p/tgBL/KuM6WO/xCXWYh7pLGwnoN1nTkYbeAZqNoYfs=; b=hqz0oD2U9HWh5EDZtbA7ZWyXN49ykA82yVKIpQpi8jvKaRqMg1ssxLl+t1/zbbddSY ID+JGyVV3IdgoVWgGhiMJ+qoLXCDAp92K2rzZuAH5JfO/RNahCaCOX6riLC3JUOHOOmK XJFWPOKbz+rVMAxNCY66M3gXtpFcmcDAPjeLc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=in-reply-to:references:mime-version:content-type:message-id:cc :content-transfer-encoding:from:subject:date:to:x-mailer; b=wWg+A85b2NypzbF3aUAfR2LI0vRFHq/L+DWeVWxciHpyuOHWZBKDnzmUepB3Ut/ryc 7k6y8zivMT7f5XdYCGcOCHmkWaSiCrpvcQRfQBt2mqkABZdfZbvtIkGgVL9d4/bed3Jr DDpp6+8etYL84k31QeaWouBD5LYyziHrey7Jo= Received: by 10.216.22.78 with SMTP id s56mr1355473wes.100.1236366311004; Fri, 06 Mar 2009 11:05:11 -0800 (PST) Received: from ?88.194.192.246? (gprs-prointernet-ffc0c200-246.dhcp.inet.fi [88.194.192.246]) by mx.google.com with ESMTPS id 35sm2818670nfu.7.2009.03.06.11.05.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 06 Mar 2009 11:05:10 -0800 (PST) In-Reply-To: <871vta8sur.GNU's_Not_Unix!%yavor@gnu.org> References: <53306724-C4E4-4E8B-BB18-9FAB4CE5EA9A@gmail.com> <871vta8sur.GNU's_Not_Unix!%yavor@gnu.org> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <1FAADEC4-9EF9-4518-B9FE-57295549C51F@gmail.com> Cc: 2264-done@debbugs.gnu.org Content-Transfer-Encoding: 7bit From: Adrian Robert Subject: Re: Failed to build emacs 23.0.90 on Ubuntu 8.10 (x86_64) Date: Fri, 6 Mar 2009 21:05:48 +0200 To: Yavor Doganov X-Mailer: Apple Mail (2.753.1) > >> Regarding the signal.h include in nsterm, can you provide some >> background or a mailing list archive link as to why it is needed? > > This is where the signal names are defined on glibc-based systems: OK, thanks, this must be for the SIGTERM use in ns_term_shutdown. On OS X it must already come in from somewhere, so including it will do no harm. I'm checking it in. You should still send the papers in though so we can use further stuff you come up with in the future. ;) From yavor@gnu.org Fri Mar 6 11:26:40 2009 Received: (at 2264) by emacsbugs.donarmstrong.com; 6 Mar 2009 19:26:40 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from f7.net (server1.f7.net [64.34.169.74]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n26JQa6O014381 for <2264@emacsbugs.donarmstrong.com>; Fri, 6 Mar 2009 11:26:37 -0800 X-Envelope-From: yavor@gnu.org X-Envelope-To: 2264@debbugs.gnu.org Received: from yavor.doganov.org (92_245.btc-net.bg [213.91.245.92] (may be forged)) by f7.net (8.11.7-20030920/8.11.7) with ESMTP id n26JQUv02642; Fri, 6 Mar 2009 13:26:30 -0600 Received: from gana.yavor.doganov.org ([192.168.0.5]) by yavor.doganov.org with esmtp (Exim 4.69) (envelope-from ) id 1Lffgi-0000eY-NX; Fri, 06 Mar 2009 21:26:29 +0200 Received: from localhost ([127.0.0.1] helo=gana.yavor.doganov.org) by gana.yavor.doganov.org with esmtp (Exim 4.69) (envelope-from ) id 1Lffgh-0003CP-Ve; Fri, 06 Mar 2009 21:26:28 +0200 Date: Fri, 06 Mar 2009 21:26:27 +0200 Message-ID: <87zlfy78rg.GNU's_Not_Unix!%yavor@gnu.org> From: Yavor Doganov To: Adrian Robert Cc: Yavor Doganov , 2264@debbugs.gnu.org In-Reply-To: <1FAADEC4-9EF9-4518-B9FE-57295549C51F@gmail.com> References: <53306724-C4E4-4E8B-BB18-9FAB4CE5EA9A@gmail.com> <871vta8sur.GNU's_Not_Unix!%yavor@gnu.org> <1FAADEC4-9EF9-4518-B9FE-57295549C51F@gmail.com> Mail-Followup-To: Adrian Robert , 2264@debbugs.gnu.org, Yavor Doganov User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.3 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI) Organization: The GNU Emacs Church (Bulgarian eparchy) X-Jabber-ID: doganov@jabber.minus273.org MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 192.168.0.5 X-SA-Exim-Mail-From: yavor@gnu.org Subject: Re: Failed to build emacs 23.0.90 on Ubuntu 8.10 (x86_64) X-SA-Exim-Version: 4.2.1 (built Wed, 25 Jun 2008 17:14:11 +0000) X-SA-Exim-Scanned: Yes (on yavor.doganov.org) Adrian Robert wrote: > OK, thanks, this must be for the SIGTERM use in ns_term_shutdown. Exactly. > I'm checking it in. Thanks. > You should still send the papers I mailed back the signed papers to the FSF's office about a month ago. It seems there are some communication problems between Boston and my city, since their first letter got lost on the way. From adrian.b.robert@gmail.com Sat Mar 7 02:35:47 2009 Received: (at 2264) by emacsbugs.donarmstrong.com; 7 Mar 2009 10:35:47 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA,FVGT_m_MULTI_ODD autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-ew0-f176.google.com (mail-ew0-f176.google.com [209.85.219.176]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n27AZhpC029336 for <2264@emacsbugs.donarmstrong.com>; Sat, 7 Mar 2009 02:35:44 -0800 Received: by ewy24 with SMTP id 24so384024ewy.1 for <2264@emacsbugs.donarmstrong.com>; Sat, 07 Mar 2009 02:35:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:in-reply-to:references :mime-version:content-type:message-id:cc:from:subject:date:to :x-mailer; bh=eamjCmHuAXe9yXIxZUAuvk3PoulLE3BzXc9j5P5029Q=; b=BVdHb2QqZuJFN+qOKzctJm5sOsmH1acRxM5wQWrcI6kgC778Tb8SstJd602BLMoadp XNwDFcjXKFn6kSoG3vm1xgTqSvM0Kq35zKrXNAuVnMSsFvljiG/t/jHmfsAV5melWc33 CXCapWpdZP5fjC1Ocah+nY8SUCGkARM4+6+vk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=in-reply-to:references:mime-version:content-type:message-id:cc:from :subject:date:to:x-mailer; b=nijVL5zLvD4wr3ByRLFNI7WeJvi9k5FQ8EpH/X9MoXFZ8lWZRG4aRfCbJ91S+B+6Qa FcXt0Dc0/cQQbELnm0RER2Lu4GTWm9jjDrYRtvtZoKF6QA6WjlQQjFI9QjTSgSa17k8p 5pjBmJO1Kv+P4PqOqxnNUf9DiFkurmMUvXI3o= Received: by 10.210.18.8 with SMTP id 8mr665225ebr.27.1236422137583; Sat, 07 Mar 2009 02:35:37 -0800 (PST) Received: from ?93.106.176.74? (gprs-prointernet-ffb06a00-74.dhcp.inet.fi [93.106.176.74]) by mx.google.com with ESMTPS id c9sm3818161nfi.34.2009.03.07.02.35.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 07 Mar 2009 02:35:36 -0800 (PST) In-Reply-To: <87wsb26tea.GNU's_Not_Unix!%yavor@gnu.org> References: <87y6vi73j7.GNU's_Not_Unix!%yavor@gnu.org> <3F164827-190B-4DF2-BF36-2F9B07B47001@gmail.com> <87wsb26tea.GNU's_Not_Unix!%yavor@gnu.org> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: multipart/mixed; boundary=Apple-Mail-5-416936115 Message-Id: <3BD8A13A-24D5-477B-BCE2-DA0C341B1825@gmail.com> Cc: 2264@debbugs.gnu.org From: Adrian Robert Subject: Re: 23.0; Emacs.app does not load ~/.emacs Date: Sat, 7 Mar 2009 12:36:13 +0200 To: Yavor Doganov X-Mailer: Apple Mail (2.753.1) --Apple-Mail-5-416936115 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > One possible way to solve the problem is to use NSZone functions > wrapped and callable from C. But unexmacosx.c does some low-level > things which are not possible with NSZone. So it is doubtful if this > approach would succeed at all. The NSZone stuff is what I meant. I didn't realize Andrew Choi ripped out the NSZone stuff when replaced it with malloc_zone when he rewrote unexnext but hopefully the difference is not important, and this is one reason why unexnext would be a better model. I'm not sure the extra stuff in unexmacosx is needed under GNUstep, because it might relate to MACH rather than ELF. Basically, the unexelfgs file that would be needed (not sure if it would be better to ifdef it in unexelf or make a new file) would combine the zone alloc stuff needed to keep objc working happily together with the existing strategies in unexelf for dealing with ELF (instead of the MACH-O strategies in unexnext/osx). Here are two version of the unexnext.c file (I'm cc'ing the bug report so they're available online). The first was unchanged over some years. The second one was updated by me to RUN on OS X 10.4 and up. I'm not sure which one, if either, would be more compatible with GNUstep, since the differences may only relate to MACH stuff. --Apple-Mail-5-416936115 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0640; name=unexnext.c Content-Disposition: attachment; filename=unexnext.c /* Dump Emacs in macho format. Copyright (C) 1990, 1993, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Written by Bradley Taylor (btaylor@next.com). This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #undef __STRICT_BSD__ #include #include #include #include #include #include #include #include #include /* Instead of unistd.h, this used to include libc.h. "Nelson H. F. Beebe" says that doesn't work in system version 3.3. */ int malloc_cookie; /* * Kludge: we don't expect any program data beyond VM_HIGHDATA * What is really needed is a way to find out from malloc() which * pages it vm_allocated and write only those out into the data segment. * * This kludge may break when we stop using fixed virtual address * shared libraries. Actually, emacs will probably continue working, but be * much larger on disk than it needs to be (because non-malloced data will * be in the file). */ static const unsigned VM_HIGHDATA = 0x2000000; typedef struct region_t { vm_address_t address; vm_size_t size; vm_prot_t protection; vm_prot_t max_protection; vm_inherit_t inheritance; boolean_t shared; port_t object_name; vm_offset_t offset; } region_t; static void grow( struct load_command ***the_commands, unsigned *the_commands_len ) { if (*the_commands == NULL) { *the_commands_len = 1; *the_commands = malloc(sizeof(*the_commands)); } else { (*the_commands_len)++; *the_commands = realloc(*the_commands, (*the_commands_len * sizeof(**the_commands))); } } static void save_command( struct load_command *command, struct load_command ***the_commands, unsigned *the_commands_len ) { struct load_command **tmp; grow(the_commands, the_commands_len); tmp = &(*the_commands)[*the_commands_len - 1]; *tmp = malloc(command->cmdsize); bcopy(command, *tmp, command->cmdsize); } static void fatal_unexec(char *format, ...) { va_list ap; va_start(ap, format); fprintf(stderr, "unexec: "); vfprintf(stderr, format, ap); fprintf(stderr, "\n"); va_end(ap); } static int read_macho( int fd, struct mach_header *the_header, struct load_command ***the_commands, unsigned *the_commands_len ) { struct load_command command; struct load_command *buf; int i; int size; if (read(fd, the_header, sizeof(*the_header)) != sizeof(*the_header)) { fatal_unexec("cannot read macho header"); return (0); } for (i = 0; i < the_header->ncmds; i++) { if (read(fd, &command, sizeof(struct load_command)) != sizeof(struct load_command)) { fatal_unexec("cannot read macho load command header"); return (0); } size = command.cmdsize - sizeof(struct load_command); if (size < 0) { fatal_unexec("bogus load command size"); return (0); } buf = malloc(command.cmdsize); buf->cmd = command.cmd; buf->cmdsize = command.cmdsize; if (read(fd, ((char *)buf + sizeof(struct load_command)), size) != size) { fatal_unexec("cannot read load command data"); return (0); } save_command(buf, the_commands, the_commands_len); } return (1); } static int filldatagap( vm_address_t start_address, vm_size_t *size, vm_address_t end_address ) { vm_address_t address; vm_size_t gapsize; address = (start_address + *size); gapsize = end_address - address; *size += gapsize; if (vm_allocate(task_self(), &address, gapsize, FALSE) != KERN_SUCCESS) { fatal_unexec("cannot vm_allocate"); return (0); } return (1); } static int get_data_region( vm_address_t *address, vm_size_t *size ) { region_t region; kern_return_t ret; struct section *sect; sect = (struct section *) getsectbyname(SEG_DATA, SECT_DATA); region.address = 0; *address = 0; for (;;) { ret = vm_region(task_self(), ®ion.address, ®ion.size, ®ion.protection, ®ion.max_protection, ®ion.inheritance, ®ion.shared, ®ion.object_name, ®ion.offset); if (ret != KERN_SUCCESS || region.address >= VM_HIGHDATA) { break; } if (*address != 0) { if (region.address > *address + *size) { if (!filldatagap(*address, size, region.address)) { return (0); } } *size += region.size; } else { if (region.address == sect->addr) { *address = region.address; *size = region.size; } } region.address += region.size; } return (1); } static char * my_malloc( vm_size_t size ) { vm_address_t address; if (vm_allocate(task_self(), &address, size, TRUE) != KERN_SUCCESS) { return (NULL); } return ((char *)address); } static void my_free( char *buf, vm_size_t size ) { vm_deallocate(task_self(), (vm_address_t)buf, size); } static int unexec_doit( int infd, int outfd ) { int i; struct load_command **the_commands = NULL; unsigned the_commands_len; struct mach_header the_header; int fgrowth = 0; int fdatastart; int fdatasize; int size; struct stat st; char *buf; vm_address_t data_address; vm_size_t data_size; vm_size_t vmaddr_growth = 0; vm_size_t dataseg_vmaddr, dataseg_vmend; struct segment_command *segment; #ifdef NS_TARGET unsigned long extreloff = 0; unsigned long nextrel = 0; struct dysymtab_command *dysymtab; struct relocation_info reloc_info; #endif if (!read_macho(infd, &the_header, &the_commands, &the_commands_len)) { return (0); } malloc_cookie = malloc_freezedry (); if (!get_data_region(&data_address, &data_size)) { return (0); } /* * DO NOT USE MALLOC IN THIS SECTION */ { /* * Fix offsets */ for (i = 0; i < the_commands_len; i++) { switch (the_commands[i]->cmd) { case LC_SEGMENT: segment = ((struct segment_command *) the_commands[i]); if (strcmp(segment->segname, SEG_DATA) == 0) { fdatastart = segment->fileoff; fdatasize = segment->filesize; fgrowth = (data_size - segment->filesize); segment->vmsize = data_size; segment->filesize = data_size; dataseg_vmaddr = segment->vmaddr; dataseg_vmend = segment->vmaddr + segment->vmsize; vmaddr_growth = segment->vmaddr + segment->vmsize; } else { ((struct segment_command *)the_commands[i])->fileoff += fgrowth; } if( strcmp( segment->segname, SEG_LINKEDIT ) == 0 ) { segment->vmaddr = vmaddr_growth; } break; case LC_SYMTAB: ((struct symtab_command *) the_commands[i])->symoff += fgrowth; ((struct symtab_command *) the_commands[i])->stroff += fgrowth; break; case LC_SYMSEG: ((struct symseg_command *) the_commands[i])->offset += fgrowth; break; #ifdef NS_TARGET case LC_DYSYMTAB: dysymtab = ((struct dysymtab_command *)the_commands[i]); extreloff = dysymtab->extreloff; nextrel = dysymtab->nextrel; dysymtab->indirectsymoff += fgrowth; dysymtab->extreloff += fgrowth; break; #endif default: break; } } /* * Write header */ if (write(outfd, &the_header, sizeof(the_header)) != sizeof(the_header)) { fatal_unexec("cannot write output file"); return (0); } /* * Write commands */ for (i = 0; i < the_commands_len; i++) { if (write(outfd, the_commands[i], the_commands[i]->cmdsize) != the_commands[i]->cmdsize) { fatal_unexec("cannot write output file"); return (0); } } /* * Write original text */ if (lseek(infd, the_header.sizeofcmds + sizeof(the_header), L_SET) < 0) { fatal_unexec("cannot seek input file"); return (0); } size = fdatastart - (sizeof(the_header) + the_header.sizeofcmds); buf = my_malloc(size); if (read(infd, buf, size) != size) { my_free(buf, size); fatal_unexec("cannot read input file"); } if (write(outfd, buf, size) != size) { my_free(buf, size); fatal_unexec("cannot write output file"); return (0); } my_free(buf, size); /* * Write new data */ if (write(outfd, (char *)data_address, data_size) != data_size) { fatal_unexec("cannot write output file"); return (0); } } /* * OKAY TO USE MALLOC NOW */ /* * Write rest of file */ fstat(infd, &st); if (lseek(infd, fdatasize, L_INCR) < 0) { fatal_unexec("cannot seek input file"); return (0); } size = st.st_size - lseek(infd, 0, L_INCR); buf = malloc(size); if (read(infd, buf, size) != size) { free(buf); fatal_unexec("cannot read input file"); return (0); } if (write(outfd, buf, size) != size) { free(buf); fatal_unexec("cannot write output file"); return (0); } free(buf); #ifdef NS_TARGET /* * Fix up relocation entries in the data segment. */ if (lseek(infd, extreloff, L_SET) < 0) { fatal_unexec("cannot seek input file"); return (0); } for (i = 0; i < nextrel; i++) { long zeroval = 0; if (read(infd, &reloc_info, sizeof (reloc_info)) != sizeof (reloc_info)) { fatal_unexec("cannot read input file"); return (0); } if (reloc_info.r_address >= dataseg_vmaddr && reloc_info.r_address < dataseg_vmend) { if (lseek (outfd, fdatastart + reloc_info.r_address - dataseg_vmaddr, L_SET) < 0 ) { fatal_unexec("cannot seek input file"); return (0); } switch (reloc_info.r_length) { case 0: if (write(outfd, &zeroval, 1) != 1) { fatal_unexec("cannot write output file"); return (0); } break; case 1: if (write(outfd, &zeroval, 2) != 2) { fatal_unexec("cannot write output file"); return (0); } break; case 2: if (write(outfd, &zeroval, 4) != 4) { fatal_unexec("cannot write output file"); return (0); } break; } } } #endif return (1); } void unexec( char *outfile, char *infile ) { int infd; int outfd; char tmpbuf[L_tmpnam]; char *tmpfile; infd = open(infile, O_RDONLY, 0); if (infd < 0) { fatal_unexec("cannot open input file `%s'", infile); exit(1); } tmpnam(tmpbuf); tmpfile = rindex(tmpbuf, '/'); if (tmpfile == NULL) { tmpfile = tmpbuf; } else { tmpfile++; } outfd = open(tmpfile, O_WRONLY|O_TRUNC|O_CREAT, 0755); if (outfd < 0) { close(infd); fatal_unexec("cannot open tmp file `%s'", tmpfile); exit(1); } if (!unexec_doit(infd, outfd)) { close(infd); close(outfd); unlink(tmpfile); exit(1); } close(infd); close(outfd); if (rename(tmpfile, outfile) < 0) { unlink(tmpfile); fatal_unexec("cannot rename `%s' to `%s'", tmpfile, outfile); exit(1); } } /* arch-tag: 9796bdc3-c050-417a-b2f5-4cfd31032634 (do not change this comment) */ --Apple-Mail-5-416936115 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed --Apple-Mail-5-416936115 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name=unexnext.c Content-Disposition: attachment; filename=unexnext.c /* Dump Emacs in macho format. Copyright (C) 1990, 1993, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Bradley Taylor (btaylor@next.com). This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #undef __STRICT_BSD__ #include #include #include #include #include #include #include #include #include /* Instead of unistd.h, this used to include libc.h. "Nelson H. F. Beebe" says that doesn't work in system version 3.3. */ #define NS_TARGET int malloc_cookie; /* * Kludge: we don't expect any program data beyond VM_HIGHDATA * What is really needed is a way to find out from malloc() which * pages it vm_allocated and write only those out into the data segment. * * This kludge may break when we stop using fixed virtual address * shared libraries. Actually, emacs will probably continue working, but be * much larger on disk than it needs to be (because non-malloced data will * be in the file). */ static const unsigned VM_HIGHDATA = 0x2000000; typedef struct region_t { vm_address_t address; vm_size_t size; vm_prot_t protection; vm_prot_t max_protection; vm_inherit_t inheritance; boolean_t shared; port_t object_name; vm_offset_t offset; } region_t; static void grow( struct load_command ***the_commands, unsigned *the_commands_len ) { if (*the_commands == NULL) { *the_commands_len = 1; *the_commands = malloc(sizeof(*the_commands)); } else { (*the_commands_len)++; *the_commands = realloc(*the_commands, (*the_commands_len * sizeof(**the_commands))); } } static void save_command( struct load_command *command, struct load_command ***the_commands, unsigned *the_commands_len ) { struct load_command **tmp; grow(the_commands, the_commands_len); tmp = &(*the_commands)[*the_commands_len - 1]; *tmp = malloc(command->cmdsize); bcopy(command, *tmp, command->cmdsize); } static void fatal_unexec(char *format, ...) { va_list ap; va_start(ap, format); fprintf(stderr, "unexec: "); vfprintf(stderr, format, ap); fprintf(stderr, "\n"); va_end(ap); } static int read_macho( int fd, struct mach_header *the_header, struct load_command ***the_commands, unsigned *the_commands_len ) { struct load_command command; struct load_command *buf; int i; int size; if (read(fd, the_header, sizeof(*the_header)) != sizeof(*the_header)) { fatal_unexec("cannot read macho header"); return (0); } for (i = 0; i < the_header->ncmds; i++) { if (read(fd, &command, sizeof(struct load_command)) != sizeof(struct load_command)) { fatal_unexec("cannot read macho load command header"); return (0); } size = command.cmdsize - sizeof(struct load_command); if (size < 0) { fatal_unexec("bogus load command size"); return (0); } buf = malloc(command.cmdsize); buf->cmd = command.cmd; buf->cmdsize = command.cmdsize; if (read(fd, ((char *)buf + sizeof(struct load_command)), size) != size) { fatal_unexec("cannot read load command data"); return (0); } save_command(buf, the_commands, the_commands_len); } return (1); } static int filldatagap( vm_address_t start_address, vm_size_t *size, vm_address_t end_address ) { vm_address_t address; vm_size_t gapsize; address = (start_address + *size); gapsize = end_address - address; *size += gapsize; if (vm_allocate(mach_task_self(), &address, gapsize, FALSE) != KERN_SUCCESS) { fatal_unexec("cannot vm_allocate"); return (0); } return (1); } static int get_data_region( vm_address_t *address, vm_size_t *size ) { region_t region; kern_return_t ret; struct section *sect; struct vm_region_basic_info info; mach_msg_type_number_t info_count = VM_REGION_BASIC_INFO_COUNT; sect = (struct section *) getsectbyname(SEG_DATA, SECT_DATA); region.address = 0; *address = 0; for (;;) { ret = vm_region(mach_task_self(), ®ion.address, ®ion.size, VM_REGION_BASIC_INFO, (vm_region_info_t) &info, &info_count, /* ®ion.protection, */ /* ®ion.max_protection, */ /* ®ion.inheritance, */ /* ®ion.shared, */ ®ion.object_name/*, ®ion.offset */); if (ret != KERN_SUCCESS || region.address >= VM_HIGHDATA) { break; } if (*address != 0) { if (region.address > *address + *size) { if (!filldatagap(*address, size, region.address)) { return (0); } } *size += region.size; } else { if (region.address == sect->addr) { *address = region.address; *size = region.size; } } region.address += region.size; } return (1); } static char * my_malloc( vm_size_t size ) { vm_address_t address; if (vm_allocate(mach_task_self(), &address, size, TRUE) != KERN_SUCCESS) { return (NULL); } return ((char *)address); } static void my_free( char *buf, vm_size_t size ) { vm_deallocate(mach_task_self(), (vm_address_t)buf, size); } static int unexec_doit( int infd, int outfd ) { int i; struct load_command **the_commands = NULL; unsigned the_commands_len; struct mach_header the_header; int fgrowth = 0; int fdatastart; int fdatasize; int size; struct stat st; char *buf; vm_address_t data_address; vm_size_t data_size; vm_size_t vmaddr_growth = 0; vm_size_t dataseg_vmaddr, dataseg_vmend; struct segment_command *segment; #ifdef NS_TARGET unsigned long extreloff = 0; unsigned long nextrel = 0; struct dysymtab_command *dysymtab; struct relocation_info reloc_info; #endif if (!read_macho(infd, &the_header, &the_commands, &the_commands_len)) { return (0); } malloc_cookie = malloc_freezedry (); if (!get_data_region(&data_address, &data_size)) { return (0); } /* * DO NOT USE MALLOC IN THIS SECTION */ { /* * Fix offsets */ for (i = 0; i < the_commands_len; i++) { switch (the_commands[i]->cmd) { case LC_SEGMENT: segment = ((struct segment_command *) the_commands[i]); if (strcmp(segment->segname, SEG_DATA) == 0) { fdatastart = segment->fileoff; fdatasize = segment->filesize; fgrowth = (data_size - segment->filesize); segment->vmsize = data_size; segment->filesize = data_size; dataseg_vmaddr = segment->vmaddr; dataseg_vmend = segment->vmaddr + segment->vmsize; vmaddr_growth = segment->vmaddr + segment->vmsize; } else { ((struct segment_command *)the_commands[i])->fileoff += fgrowth; } if( strcmp( segment->segname, SEG_LINKEDIT ) == 0 ) { segment->vmaddr = vmaddr_growth; } break; case LC_SYMTAB: ((struct symtab_command *) the_commands[i])->symoff += fgrowth; ((struct symtab_command *) the_commands[i])->stroff += fgrowth; break; case LC_SYMSEG: ((struct symseg_command *) the_commands[i])->offset += fgrowth; break; #ifdef NS_TARGET case LC_DYSYMTAB: dysymtab = ((struct dysymtab_command *)the_commands[i]); extreloff = dysymtab->extreloff; nextrel = dysymtab->nextrel; dysymtab->indirectsymoff += fgrowth; dysymtab->extreloff += fgrowth; break; #endif default: break; } } /* * Write header */ if (write(outfd, &the_header, sizeof(the_header)) != sizeof(the_header)) { fatal_unexec("cannot write output file"); return (0); } /* * Write commands */ for (i = 0; i < the_commands_len; i++) { if (write(outfd, the_commands[i], the_commands[i]->cmdsize) != the_commands[i]->cmdsize) { fatal_unexec("cannot write output file"); return (0); } } /* * Write original text */ if (lseek(infd, the_header.sizeofcmds + sizeof(the_header), L_SET) < 0) { fatal_unexec("cannot seek input file"); return (0); } size = fdatastart - (sizeof(the_header) + the_header.sizeofcmds); buf = my_malloc(size); if (read(infd, buf, size) != size) { my_free(buf, size); fatal_unexec("cannot read input file"); } if (write(outfd, buf, size) != size) { my_free(buf, size); fatal_unexec("cannot write output file"); return (0); } my_free(buf, size); /* * Write new data */ if (write(outfd, (char *)data_address, data_size) != data_size) { fatal_unexec("cannot write output file"); return (0); } } /* * OKAY TO USE MALLOC NOW */ /* * Write rest of file */ fstat(infd, &st); if (lseek(infd, fdatasize, L_INCR) < 0) { fatal_unexec("cannot seek input file"); return (0); } size = st.st_size - lseek(infd, 0, L_INCR); buf = malloc(size); if (read(infd, buf, size) != size) { free(buf); fatal_unexec("cannot read input file"); return (0); } if (write(outfd, buf, size) != size) { free(buf); fatal_unexec("cannot write output file"); return (0); } free(buf); #ifdef NS_TARGET /* * Fix up relocation entries in the data segment. */ if (lseek(infd, extreloff, L_SET) < 0) { fatal_unexec("cannot seek input file"); return (0); } for (i = 0; i < nextrel; i++) { long zeroval = 0; if (read(infd, &reloc_info, sizeof (reloc_info)) != sizeof (reloc_info)) { fatal_unexec("cannot read input file"); return (0); } if (reloc_info.r_address >= dataseg_vmaddr && reloc_info.r_address < dataseg_vmend) { if (lseek (outfd, fdatastart + reloc_info.r_address - dataseg_vmaddr, L_SET) < 0 ) { fatal_unexec("cannot seek input file"); return (0); } switch (reloc_info.r_length) { case 0: if (write(outfd, &zeroval, 1) != 1) { fatal_unexec("cannot write output file"); return (0); } break; case 1: if (write(outfd, &zeroval, 2) != 2) { fatal_unexec("cannot write output file"); return (0); } break; case 2: if (write(outfd, &zeroval, 4) != 4) { fatal_unexec("cannot write output file"); return (0); } break; } } } #endif return (1); } void unexec( char *outfile, char *infile, void *start_data, void *start_bss, void *entry_address ) { int infd; int outfd; char tmpbuf[L_tmpnam]; char *tmpfile; infd = open(infile, O_RDONLY, 0); if (infd < 0) { fatal_unexec("cannot open input file `%s'", infile); exit(1); } tmpnam(tmpbuf); tmpfile = rindex(tmpbuf, '/'); if (tmpfile == NULL) { tmpfile = tmpbuf; } else { tmpfile++; } outfd = open(tmpfile, O_WRONLY|O_TRUNC|O_CREAT, 0755); if (outfd < 0) { close(infd); fatal_unexec("cannot open tmp file `%s'", tmpfile); exit(1); } if (!unexec_doit(infd, outfd)) { close(infd); close(outfd); unlink(tmpfile); exit(1); } close(infd); close(outfd); if (rename(tmpfile, outfile) < 0) { unlink(tmpfile); fatal_unexec("cannot rename `%s' to `%s'", tmpfile, outfile); exit(1); } } /* arch-tag: 9796bdc3-c050-417a-b2f5-4cfd31032634 (do not change this comment) */ --Apple-Mail-5-416936115 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed --Apple-Mail-5-416936115-- From unknown Wed Jun 25 09:10:47 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Sat, 04 Apr 2009 14:24:05 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator