Bug 118823 - [patch] Remove -pipe from sys.mk it cripples small machines
Summary: [patch] Remove -pipe from sys.mk it cripples small machines
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 6.2-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-18 15:00 UTC by jhs
Modified: 2007-12-25 13:51 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (378 bytes, patch)
2007-12-18 15:00 UTC, jhs
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jhs 2007-12-18 15:00:11 UTC
	Remove -pipe from /usr/share/mk/sys.mk it cripples small machines

Fix: Patch appended.

To: stable@@freebsd.org
Fcc: sent
In-reply-to: <200712181108.lBIB8rAL090380@@fire.js.berklix.net> 
References: <200712181108.lBIB8rAL090380@@fire.js.berklix.net>
Comments: In-reply-to "Julian Stacey" <jhs@@berklix.org>
   message dated "Tue, 18 Dec 2007 12:08:53 +0100."

> Has 7.0-BETA4 perhaps wrongly got a -pipe in the .mk macros ?
> Please someone with generic 7.0BETA4 check with eg:
> 	A single line /etc/make.conf
> 		CFLAGS += -Dzonk=bla
> 	~/tmp/Makefile
> 		tst:
>         		@echo "XX ${CFLAGS} YY"
> 	make tst
> 		XX -O2 -fno-strict-aliasing -pipe -Dzonk=bla  YY
> Is pipe coming from generic mk/ ?
> Or from my local hacked version  ?
> Could someone test please:
> 	My /usr/src is no longer generic, on a very slow CPU, SLIP
> 	linked, building rest of src/ & I'm about to go away, &
> 	will miss the 7-RELEASE date, but -pipe should not be in
> 	generic, needs to be a host dependent choice. )

Error found. I will send-pr.  Patch below stored in :
http://berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/gen/share/mk/sys.mk.REL=ALL.diff

pipe should not be on by default as
- It cripples machines with limited memory.
- Pipe can be enabled by any memory rich host in /etc/make.conf with:
	CFLAGS += -pipe
- Man cc lists how to turn it on but not off.
- Man cc also notes assembler problems 



-- 
Julian Stacey. Munich Computer Consultant, BSD Unix C Linux. http://berklix.com
	Ihr Rauch = mein allergischer Kopfschmerz. Dump cigs 4 snuff.--ZW9mzaWIbbvrjKhFPowJ9pdg9x7T4AGehN8Y2MInTGgnL25Z
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

*** -current/src/share/mk/sys.mk.orig	Tue Dec 18 15:11:26 2007
--- -current/src/share/mk/sys.mk	Tue Dec 18 15:12:23 2007
***************
*** 36,44 ****
  .else
  CC		?=	cc
  .if ${MACHINE_ARCH} == "arm"
! CFLAGS		?=	-O -fno-strict-aliasing -pipe
  .else
! CFLAGS		?=	-O2 -fno-strict-aliasing -pipe
  .endif
  .if defined(NO_STRICT_ALIASING)
  CFLAGS		+=	-fno-strict-aliasing
--- 36,44 ----
  .else
  CC		?=	cc
  .if ${MACHINE_ARCH} == "arm"
! CFLAGS		?=	-O -fno-strict-aliasing
  .else
! CFLAGS		?=	-O2 -fno-strict-aliasing
  .endif
  .if defined(NO_STRICT_ALIASING)
  CFLAGS		+=	-fno-strict-aliasing
How-To-Repeat: 	
	Any older machine with not much RAM or swap
	cd /usr/src/gnu/usr.bin/cc/cc_int ; make
	Watch it eat swap on eg
		cc -O2 -fno-strict-aliasing -Dzonk=bla  -DIN_GCC -DHAVE_CONFIG_H -DPREFIX=\"/usr\" -I/usr/obj/usr/src/gnu/usr.bin/cc/cc_int/../cc_tools -I/usr/src/gnu/usr.bin/cc/cc_int/../cc_tools -I/usr/src/gnu/usr.bin/cc/cc_int/../../../../contrib/gcc -I/usr/src/gnu/usr.bin/cc/cc_int/../../../../contrib/gcc/config -I/usr/src/gnu/usr.bin/cc/cc_int/../../../../contrib/gcclibs/include -I/usr/src/gnu/usr.bin/cc/cc_int/../../../../contrib/gcclibs/libcpp/include -I/usr/src/gnu/usr.bin/cc/cc_int/../../../../contrib/gcclibs/libdecnumber  -c ../cc_tools/insn-attrtab.c
		OK im not sure thats the right proof, but thats how I found this bug.
Comment 1 Kris Kennaway freebsd_committer freebsd_triage 2007-12-25 13:32:11 UTC
State Changed
From-To: open->closed

The default of -pipe is appropriate for modern systems since it 
improves compiler performance.  It can trivially be tuned on smaller 
systems by editing /etc/make.conf, so this change is not necessary.