From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 25 12:09:01 2010 Return-Path: Delivered-To: hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30E641065673 for ; Thu, 25 Nov 2010 12:09:01 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by mx1.freebsd.org (Postfix) with ESMTP id CE75F8FC0C for ; Thu, 25 Nov 2010 12:09:00 +0000 (UTC) Received: from [192.168.0.22] (0x573fa596.cpe.ge-1-1-0-1109.ronqu1.customer.tele.dk [87.63.165.150]) by csmtp3.one.com (Postfix) with ESMTP id F1724240634B for ; Thu, 25 Nov 2010 12:08:58 +0000 (UTC) From: Erik Cederstrand Content-Type: multipart/signed; boundary=Apple-Mail-195-994609787; protocol="application/pkcs7-signature"; micalg=sha1 Date: Thu, 25 Nov 2010 13:08:58 +0100 Message-Id: <93FA0AC7-704D-4EB4-A163-FDD8AC915630@cederstrand.dk> To: FreeBSD Hackers Mime-Version: 1.0 (Apple Message framework v1082) X-Mailer: Apple Mail (2.1082) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Deterministic builds, part 2 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Nov 2010 12:09:01 -0000 --Apple-Mail-195-994609787 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hello hackers, With a simple version of deterministic builds done (see my previous post = here - anyone willing to comment the patch?), I have started to look at = the more general case where OBJDIR and SRCDIR change between builds. The = following are my findings. Kernel modules: ---------------------- In the ELF section .gnu-debuglink, there is a link to the corresponding = *.ko.symbols file. It seems to be an inode or such rather than a file = path since nothing shows up in strings(1). I have commented out = "makeoptions DEBUG=3D-g" in the GENERIC kernel conf file which I am = testing now, but I'd like to know what is actually going on. Symbol tables: -------------------- For example, libstand.a shows up in a diff. Looking with objdump, I see = the contained _setjmp.o file has the following symbol table: SYMBOL TABLE: 00000000 l df *ABS* 00000000 = /usr/home/erik/freebsd/head1/src/lib/libstand/i386/_setjmp.S 00000000 l df *ABS* 00000000 ./machine/asm.h 00000000 l df *ABS* 00000000 = /home/erik/freebsd/obj1/usr/home/erik/freebsd/head1/src/tmp/usr/include/sy= s/cdefs.h 00000000 l df *ABS* 00000000 ./machine/asm.h 00000000 l df *ABS* 00000000 = /usr/home/erik/freebsd/head1/src/lib/libstand/i386/_setjmp.S 00000000 l df *ABS* 00000000 00000000 l df *ABS* 00000000 00000000 l df *ABS* 00000000 = /usr/home/erik/freebsd/head1/src/lib/libstand/i386/_setjmp.S 00000000 l d .text 00000000=20 00000000 l d .data 00000000=20 00000000 l d .bss 00000000=20 00000000 g F .text 0000001d _setjmp 00000020 g F .text 00000024 _longjmp There are absolute paths within SRCDIR and OBJDIR. I'm pretty sure = libarchive.a will still work at runtime if I blow away those = directories. I could really use some help changing the paths to be = relative to SRJ/OBJDIR if that makes sense, or even removing them if = that's better. rodata.str1.4: ------------------ Some *.o files (all?) contain the path to the corresponding source file: Contents of section .rodata.str1.4: 0000 2f757372 2f686f6d 652f6572 696b2f66 /usr/home/erik/f 0010 72656562 73642f68 6561642f 7372632f reebsd/head1/src/ 0020 6c69622f 6c696273 74616e64 2f6f7065 lib/libstand/ope 0030 6e2e6300 n.c. As with the symbol tables, is it possible to change these to relative = paths, or just remove them? If there are no flags to gcc or other tricks to do this, I've thought = about calling strip(1) within the build process to remove the things I = don't want. Thanks, Erik= --Apple-Mail-195-994609787--