Skip to content

Instantly share code, notes, and snippets.

@tsutsui
Created June 25, 2014 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsutsui/70b93c666adc20b83de9 to your computer and use it in GitHub Desktop.
Save tsutsui/70b93c666adc20b83de9 to your computer and use it in GitHub Desktop.
Patch to specify "-O2 -fno-reorder-blocks" on NetBSD/m68k 6.1.4 (gcc 4.5.3)
Index: external/public-domain/sqlite/lib/Makefile
===================================================================
RCS file: /cvsroot/src/external/public-domain/sqlite/lib/Makefile,v
retrieving revision 1.1
diff -u -p -d -r1.1 Makefile
--- external/public-domain/sqlite/lib/Makefile 13 Oct 2011 21:40:28 -0000 1.1
+++ external/public-domain/sqlite/lib/Makefile 25 Jun 2014 14:57:49 -0000
@@ -14,4 +14,11 @@ FILESGRP_sqlite3.pc= ${BINGRP}
FILESMODE_sqlite3.pc= ${NONBINMODE}
FILESDIR_sqlite3.pc= /usr/lib/pkgconfig
+.include <bsd.own.mk>
+
+.if ${MACHINE_CPU} == "m68k"
+# XXX: workaround to avoid "Warning: .word .L16376-.L16496+0 didn't fit"
+COPTS+= -fno-tree-vrp -fno-tree-pre
+.endif
+
.include <bsd.lib.mk>
Index: share/mk/sys.mk
===================================================================
RCS file: /cvsroot/src/share/mk/sys.mk,v
retrieving revision 1.108.2.1
diff -u -p -d -r1.108.2.1 sys.mk
--- share/mk/sys.mk 17 May 2012 18:02:30 -0000 1.108.2.1
+++ share/mk/sys.mk 25 Jun 2014 14:57:53 -0000
@@ -24,8 +24,8 @@ CC?= cc
# -O2 is too -falign-* zealous for low-memory sh3 machines
DBG?= -Os -freorder-blocks
.elif ${MACHINE_ARCH} == "m68k" || ${MACHINE_ARCH} == "m68000"
-# see src/doc/HACKS for details
-DBG?= -Os
+# -freorder-blocks (enabled by -O2) produces much bigger code
+DBG?= -O2 -fno-reorder-blocks
.elif ${MACHINE_ARCH} == "vax"
DBG?= -O1 -fgcse -fstrength-reduce -fgcse-after-reload
.else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment