Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 01 Oct 2016 02:05:09 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 213137] boot2 too large when using gcc-4.6 or later
Message-ID:  <bug-213137-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D213137

            Bug ID: 213137
           Summary: boot2 too large when using gcc-4.6 or later
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: nigoro.dev@gmail.com

Created attachment 175328
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D175328&action=
=3Dedit
sample patch for sys/boot/i386/boot2/Makefile

If -fasynchronous-unwind-tables is enabled, the size of boot2 is too large.

# gcc46 -Os -Q --help=3Doptimize | grep unwind-tables
  -fasynchronous-unwind-tables          [enabled]
  -funwind-tables                       [disabled]

Steps to Reproduce)
# pkg install gcc46 (or new version that you want)
# cd /usr/src/sys/boot
# CC=3Dgcc46 make

Part of log)
gcc46 -fomit-frame-pointer  -mrtd  -mregparm=3D3  -DUSE_XREAD  -DUFS1_AND_U=
FS2=20
-DFLAGS=3D0x80  -DSIOPRT=3D0x3f8  -DSIOFMT=3D0x3  -DSIOSPD=3D9600=20
-I/usr/src/sys/boot/i386/boot2/../../common=20
-I/usr/src/sys/boot/i386/boot2/../btx/lib -I.  -Wall -Waggregate-return
-Wbad-function-cast -Wcast-align  -Wmissing-declarations -Wmissing-prototyp=
es
-Wnested-externs  -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-stri=
ngs=20
-Winline -march=3Di386 -ffreestanding -mno-mmx -mno-sse  -msoft-float -m32 =
-g=20
-std=3Dgnu99     -Os  -fno-guess-branch-probability  -fno-unit-at-a-time  -=
-param
max-inline-insns-single=3D100 -mpreferred-stack-boundary=3D2   -m32  -c sio=
.S -o
sio.o
ld -static -N --gc-sections -m elf_i386_fbsd -Ttext 0x2000 -o boot2.out
/usr/src/sys/boot/i386/boot2/../btx/lib/crt0.o boot2.o sio.o
objcopy -S -O binary boot2.out boot2.bin
btxld -v -E 0x2000 -f bin -b /usr/src/sys/boot/i386/boot2/../btx/btx/btx -l
boot2.ldr  -o boot2.ld -P 1 boot2.bin
kernel: ver=3D1.02 size=3D690 load=3D9000 entry=3D9010 map=3D16M pgctl=3D1:1
client: fmt=3Dbin size=3D17a1 text=3D0 data=3D0 bss=3D0 entry=3D0
output: fmt=3Dbin size=3D2031 text=3D200 data=3D1e31 org=3D0 entry=3D0
-561 bytes available
*** Error code 1

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-213137-8>