diff --git a/Tuprules.tup b/Tuprules.tup index 1a18aa842..519e25fb9 100644 --- a/Tuprules.tup +++ b/Tuprules.tup @@ -12,23 +12,13 @@ else CC = gcc endif -ifeq (@(TUP_DEBUG),y) -CFLAGS += -g -else -CFLAGS += -Os -endif - -ifdef AR -AR = @(AR) +CFLAGS += -D_FILE_OFFSET_BITS=64 +CFLAGS += -I$(TUP_CWD)/src +ifdef CFLAGS +CFLAGS += @(CFLAGS) else -AR = ar -endif - CFLAGS += -W CFLAGS += -Wall -ifeq (@(TUP_WERROR),y) -CFLAGS += -Werror -endif CFLAGS += -Wbad-function-cast CFLAGS += -Wcast-align CFLAGS += -Wcast-qual @@ -42,12 +32,17 @@ CFLAGS += -Wstrict-prototypes CFLAGS += -Wwrite-strings CFLAGS += -Wswitch-enum CFLAGS += -fno-common -CFLAGS += -D_FILE_OFFSET_BITS=64 -CFLAGS += -I$(TUP_CWD)/src +CFLAGS += -O2 +endif + +ifdef LDFLAGS +LDFLAGS += @(LDFLAGS) +endif -ifeq (@(TUP_32_BIT),y) -CFLAGS += -m32 -LDFLAGS += -m32 +ifdef AR +AR = @(AR) +else +AR = ar endif export PKG_CONFIG_PATH diff --git a/configs/gcc-dev-lto.config b/configs/gcc-dev-lto.config new file mode 100644 index 000000000..27da74499 --- /dev/null +++ b/configs/gcc-dev-lto.config @@ -0,0 +1,3 @@ +CONFIG_CFLAGS=-W -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Wswitch-enum -Werror -flto -fno-common -g -Og +CONFIG_AR=gcc-ar +CONFIG_LDFLAGS=-flto -fuse-linker-plugin diff --git a/configs/gcc-dev.config b/configs/gcc-dev.config new file mode 100644 index 000000000..ab2811b8f --- /dev/null +++ b/configs/gcc-dev.config @@ -0,0 +1 @@ +CONFIG_CFLAGS=-W -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Wswitch-enum -Werror -fno-common -g -Og diff --git a/configs/gcc-release.config b/configs/gcc-release.config new file mode 100644 index 000000000..72944f41e --- /dev/null +++ b/configs/gcc-release.config @@ -0,0 +1 @@ +CONFIG_CFLAGS=-Wall -fno-common -O2