From owner-freebsd-current@FreeBSD.ORG Wed May 25 03:08:53 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99DE3106564A; Wed, 25 May 2011 03:08:53 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 571318FC08; Wed, 25 May 2011 03:08:53 +0000 (UTC) Received: by iwn33 with SMTP id 33so9135526iwn.13 for ; Tue, 24 May 2011 20:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=XF5SD+t9vjY6kjhW0HiPww+tj/V0GMzkEo9C7gqIj6I=; b=rFho4tIBxfT4AC/hmotfN6z7O4fK9f2bVMywDEb4sUQV1T7Km3K7ygqL1XF2fj5eG3 +aHx+kzRo1CGAj2Te+2eX2GzPHLujFQ3p7OFvJhS8CS3HgM1zbX7AObtJt1+KuHD5Rnw HyYrf3G37EuhVHglQNOk8lchGwPXGoaWkkwAk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=VaJ6LlcX5OUw0ANpS+37TynTS3aoxEf1tymaRrmZWpq9lpGLhgobjoUCobSsx8hD4f VmjdYLe8ZdwdonTClbUbdr4ueTcM9fOQMtF4zQ6wr37stbZYoq551+bUME/lPkYd4YjT hU5NNh/Z7hnC05cLKLo1suLAvpm1CrlRFJKIc= MIME-Version: 1.0 Received: by 10.42.134.67 with SMTP id k3mr10459260ict.478.1306292932563; Tue, 24 May 2011 20:08:52 -0700 (PDT) Received: by 10.42.177.10 with HTTP; Tue, 24 May 2011 20:08:52 -0700 (PDT) In-Reply-To: References: <1306267772-31084-1-git-send-email-lacombar@gmail.com> <4DDC17E5.2020700@FreeBSD.org> Date: Tue, 24 May 2011 23:08:52 -0400 Message-ID: From: Arnaud Lacombe To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: current@freebsd.org Subject: Re: [PATCH] Fix CFLAGS overwrite by Makefile X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 03:08:53 -0000 Hi, On Tue, May 24, 2011 at 10:54 PM, Arnaud Lacombe wrote: > ps: for static library and loader, I derived the total size as the sum > of the size of the text/data/bss section of the member object using : > > size *.o | awk 'BEGIN {text=0; data=0; bss=0;}; {text+=$1; data+=$2; > bss+=$3}; END {print text " " data " " bss " '$i'"}' > > where $i is the cpu type to test. make(1) is passed either CPUTYPE=$i > for i in i[3456]86, or the empty string. The compiler used for the > test is gcc, and it is the compiler build during a buildworld stage, > in the tmp directory. > just to cut loose any question about my environment, additionally to the original patch, I made the following modification to the tree to try to isolate it from the host: - applied the following patch: diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile index 05f0995..06592cd 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile @@ -19,14 +19,14 @@ WARNS?= 0 CFLAGS+= -ffreestanding -Wformat CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${.CURDIR}/../../include +CFLAGS+= -I${.CURDIR}/../../sys .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif -.if ${MACHINE} == "pc98" -CFLAGS+= -Os -.endif +#CFLAGS+= -Os .if ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG .endif diff --git a/sys/boot/i386/libi386/Makefile b/sys/boot/i386/libi386/Makefile index 7940471..1af3f44 100644 --- a/sys/boot/i386/libi386/Makefile +++ b/sys/boot/i386/libi386/Makefile @@ -51,6 +51,8 @@ CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../../contrib/dev/acpica/include \ -I${.CURDIR}/../../.. -I. # the location of libstand +CFLAGS+= -I${.CURDIR}/../../../../include +CFLAGS+= -I${.CURDIR}/../../../../sys CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ .if ${CC:T:Mclang} == "clang" - manually created two symlinks: 1) include/machine -> ../sys/i386/include/ 2) include/x86 -> ../sys/x86/include/ The host is running a custom 8.2-STABLE/amd64 kernel (only config change) on the following CPU: CPU: Intel(R) Xeon(R) CPU X3430 @ 2.40GHz (2394.00-MHz K8-class CPU) Origin = "GenuineIntel" Id = 0x106e5 Family = 6 Model = 1e Stepping = 5 Features=0xbfebfbff Features2=0x98e3fd AMD Features=0x28100800 AMD Features2=0x1 TSC: P-state invariant I am still not sure what is the default gcc target architecture on this machine. - Arnaud