Re: [PATCH] Fix CFLAGS overwrite by Makefile

From: Arnaud Lacombe <lacombar_at_gmail.com>
Date: Tue, 24 May 2011 23:08:52 -0400
Hi,

On Tue, May 24, 2011 at 10:54 PM, Arnaud Lacombe <lacombar_at_gmail.com> 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
_at__at_ -19,14 +19,14 _at__at_ 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
_at__at_ -51,6 +51,8 _at__at_ 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  _at_ 2.40GHz (2394.00-MHz K8-class CPU)
  Origin = "GenuineIntel"  Id = 0x106e5  Family = 6  Model = 1e  Stepping = 5
 Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x98e3fd<SSE3,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT>
  AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
  AMD Features2=0x1<LAHF>
  TSC: P-state invariant

I am still not sure what is the default gcc target architecture on this machine.

 - Arnaud
Received on Wed May 25 2011 - 01:08:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:14 UTC