Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Version 1.07.0
[added]
- CVA_LIST type, CVA_START(), CVA_COPY() CVA_END(), CVA_ARG() macros will map to gcc's __builtin_va_list and __builtin_va_* macros in gcc backend
- github #133: fbc makefile supports bootstrap-minimal target to build a bootstrap fbc with only the minimal features necessary to build another fbc. (William Breathitt Gray)
- github #141: introduced '-strip'/'-nostrip' options to control symbol stripping of output files (William Breathitt Gray)
- github #141: fbc will default to stripping symbols if '-d ENABLE_STRIPALL' is passed in FBCFLAGS (William Breathitt Gray)
- github #141: makefile option 'ENABLE_STRIPALL=1' introduced to pass '-d ENABLE_STRIPALL' via FBCFLAGS by default for dos/win32 targets (William Breathitt Gray)

[fixed]
- sf.net #881: C backend: support for varadic function parameters in gcc using __builtin_va_list type and related macros
Expand Down
8 changes: 8 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
# ENABLE_SUFFIX=-0.24 append a string like "-0.24" to fbc/FB dir names,
# and use "-d ENABLE_SUFFIX=$(ENABLE_SUFFIX)" (non-standalone only)
# ENABLE_LIB64=1 use prefix/lib64/ instead of prefix/lib/ for 64bit libs (non-standalone only)
# ENABLE_STRIPALL=1 use "-d ENABLE_STRIPALL" with select targets
# FBPACKAGE bindist: The package/archive file name without path or extension
# FBPACKSUFFIX bindist: Allows adding a custom suffix to the normal package name (and the toplevel dir in the archive)
# FBMANIFEST bindist: The manifest file name without path or extension
Expand All @@ -92,6 +93,7 @@
# -d ENABLE_SUFFIX=-0.24 assume FB's lib dir uses the given suffix (non-standalone only)
# -d ENABLE_PREFIX=/some/path hard-code specific $(prefix) into fbc
# -d ENABLE_LIB64 use prefix/lib64/ instead of prefix/lib/ for 64bit libs (non-standalone only)
# -d ENABLE_STRIPALL configure fbc to pass down '--strip-all' to linker by default
#
# rtlib/gfxlib2 source code configuration (CFLAGS):
# -DDISABLE_X11 build without X11 headers (disables X11 gfx driver)
Expand Down Expand Up @@ -429,6 +431,12 @@ endif
ifdef ENABLE_LIB64
ALLFBCFLAGS += -d ENABLE_LIB64
endif
ifdef ENABLE_STRIPALL
ifneq ($(filter dos win32,$(TARGET_OS)),)
ALLFBCFLAGS += -d ENABLE_STRIPALL
endif
endif


ALLFBCFLAGS += $(FBCFLAGS) $(FBFLAGS)
ALLFBLFLAGS += $(FBLFLAGS) $(FBFLAGS)
Expand Down
21 changes: 20 additions & 1 deletion src/compiler/fbc.bas
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ type FBCCTX
xbe_title as zstring * FB_MAXNAMELEN+1 '' For the '-title <title>' xbox option
nodeflibs as integer
staticlink as integer
stripsymbols as integer

'' Compiler paths
prefix as zstring * FB_MAXPATHLEN+1 '' Path from -prefix or empty
Expand Down Expand Up @@ -163,6 +164,10 @@ private sub fbcInit( )

fbGlobalInit()

#ifdef ENABLE_STRIPALL
fbc.stripsymbols = TRUE
#endif

fbc.objinf.lang = fbGetOption( FB_COMPOPT_LANG )

fbc.print = -1
Expand Down Expand Up @@ -762,7 +767,7 @@ private function hLinkFiles( ) as integer

if( fbGetOption( FB_COMPOPT_DEBUGINFO ) = FALSE ) then
if( fbGetOption( FB_COMPOPT_PROFILE ) = FALSE ) then
if( fbGetOption( FB_COMPOPT_TARGET ) <> FB_COMPTARGET_DARWIN ) then
if( fbc.stripsymbols ) then
ldcline += " -s"
end if
end if
Expand Down Expand Up @@ -1417,6 +1422,7 @@ enum
OPT_NODEFLIBS
OPT_NOERRLINE
OPT_NOOBJINFO
OPT_NOSTRIP
OPT_O
OPT_OPTIMIZE
OPT_P
Expand All @@ -1432,6 +1438,7 @@ enum
OPT_S
OPT_SHOWINCLUDES
OPT_STATIC
OPT_STRIP
OPT_T
OPT_TARGET
OPT_TITLE
Expand Down Expand Up @@ -1480,6 +1487,7 @@ dim shared as integer option_takes_argument(0 to (OPT__COUNT - 1)) = _
FALSE, _ '' OPT_NODEFLIBS
FALSE, _ '' OPT_NOERRLINE
FALSE, _ '' OPT_NOOBJINFO
FALSE, _ '' OPT_NOSTRIP
TRUE , _ '' OPT_O
TRUE , _ '' OPT_OPTIMIZE
TRUE , _ '' OPT_P
Expand All @@ -1495,6 +1503,7 @@ dim shared as integer option_takes_argument(0 to (OPT__COUNT - 1)) = _
TRUE , _ '' OPT_S
FALSE, _ '' OPT_SHOWINCLUDES
FALSE, _ '' OPT_STATIC
FALSE, _ '' OPT_STRIP
TRUE , _ '' OPT_T
TRUE , _ '' OPT_TARGET
TRUE , _ '' OPT_TITLE
Expand Down Expand Up @@ -1676,6 +1685,9 @@ private sub handleOpt(byval optid as integer, byref arg as string)
case OPT_NOOBJINFO
fbSetOption( FB_COMPOPT_OBJINFO, FALSE )

case OPT_NOSTRIP
fbc.stripsymbols = FALSE

case OPT_O
'' Error if there already is an -o waiting to be assigned
hCheckWaitingObjfile( )
Expand Down Expand Up @@ -1765,6 +1777,9 @@ private sub handleOpt(byval optid as integer, byref arg as string)
case OPT_STATIC
fbc.staticlink = TRUE

case OPT_STRIP
fbc.stripsymbols = TRUE

case OPT_T
fbSetOption( FB_COMPOPT_STACKSIZE, clng( arg ) * 1024 )

Expand Down Expand Up @@ -1963,6 +1978,7 @@ private function parseOption(byval opt as zstring ptr) as integer
CHECK("noerrline", OPT_NOERRLINE)
CHECK("nodeflibs", OPT_NODEFLIBS)
CHECK("noobjinfo", OPT_NOOBJINFO)
CHECK("nostrip", OPT_NOSTRIP)

case asc("o")
ONECHAR(OPT_O)
Expand Down Expand Up @@ -1990,6 +2006,7 @@ private function parseOption(byval opt as zstring ptr) as integer
ONECHAR(OPT_S)
CHECK("showincludes", OPT_SHOWINCLUDES)
CHECK("static", OPT_STATIC)
CHECK("strip", OPT_STRIP)

case asc("t")
ONECHAR(OPT_T)
Expand Down Expand Up @@ -3384,6 +3401,7 @@ private sub hPrintOptions( )
print " -nodeflibs Do not include the default libraries"
print " -noerrline Do not show source context in error messages"
print " -noobjinfo Do not read/write compile-time info from/to .o and .a files"
print " -nostrip Do not strip symbol information from the output file"
print " -o <file> Set .o (or -pp .bas) file name for prev/next input file"
print " -O <value> Optimization level (default: 0)"
print " -p <path> Add a library search path"
Expand All @@ -3401,6 +3419,7 @@ private sub hPrintOptions( )
print " -s console|gui Select win32 subsystem"
print " -showincludes Display a tree of file names of #included files"
print " -static Prefer static libraries over dynamic ones when linking"
print " -strip Omit all symbol information from the output file"
print " -t <value> Set .exe stack size in kbytes, default: 1024 (win32/dos)"
print " -target <name> Set cross-compilation target"
print " -title <name> Set XBE display title (xbox)"
Expand Down