Skip to content

Commit

Permalink
Don't clobber CFLAGS_EXTRAS in tests.
Browse files Browse the repository at this point in the history
To run tests against a different target platform many extra compiler flags are
needed to specify sysroot, include dirs, etc. The environment variable
CFLAGS_EXTRAS seems suited for this purpose except that several Makefiles
clobber the current flags. This change modifies all of these to add to
CFLAGS_EXTRAS instead.

Test Plan:
Verify no regressions in ninja check-lldb.
Run tests using CFLAGS_EXTRAS to specify cross compilation flags for a different
target running lldb-server platform.

Differential Revision: http://reviews.llvm.org/D8559

llvm-svn: 233066
  • Loading branch information
flackr committed Mar 24, 2015
1 parent c99ce68 commit 666a986
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lldb/test/expression_command/call-function/Makefile
Expand Up @@ -6,7 +6,7 @@ CXX_SOURCES := main.cpp
# targets. Other targets do not, which causes this test to fail.
# This flag enables FullDebugInfo for all targets.
ifneq (,$(findstring clang,$(CC)))
CFLAGS_EXTRAS := -fno-limit-debug-info
CFLAGS_EXTRAS += -fno-limit-debug-info
endif

include $(LEVEL)/Makefile.rules
Expand Down
@@ -1,6 +1,6 @@
LEVEL = ../../../make

C_SOURCES := main.c
CFLAGS_EXTRAS := -std=c99
CFLAGS_EXTRAS += -std=c99

include $(LEVEL)/Makefile.rules
Expand Up @@ -6,7 +6,7 @@ CXX_SOURCES := main.cpp
# targets. Other targets do not, which causes this test to fail.
# This flag enables FullDebugInfo for all targets.
ifneq (,$(findstring clang,$(CC)))
CFLAGS_EXTRAS := -fno-limit-debug-info
CFLAGS_EXTRAS += -fno-limit-debug-info
endif

include $(LEVEL)/Makefile.rules
Expand Down
Expand Up @@ -2,14 +2,14 @@ LEVEL = ../../../../../make

CXX_SOURCES := main.cpp

CFLAGS_EXTRAS := -O0
CFLAGS_EXTRAS += -O0
USE_LIBSTDCPP := 1

# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD
# targets. Other targets do not, which causes this test to fail.
# This flag enables FullDebugInfo for all targets.
ifneq (,$(findstring clang,$(CC)))
CFLAGS_EXTRAS := -fno-limit-debug-info
CFLAGS_EXTRAS += -fno-limit-debug-info
endif

include $(LEVEL)/Makefile.rules
Expand Up @@ -2,7 +2,7 @@ LEVEL = ../../../../../make

CXX_SOURCES := main.cpp

CFLAGS_EXTRAS := -O0
CFLAGS_EXTRAS += -O0
USE_LIBSTDCPP := 1

# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD
Expand Down
Expand Up @@ -2,7 +2,7 @@ LEVEL = ../../../../../make

CXX_SOURCES := main.cpp

CFLAGS_EXTRAS := -O0
CFLAGS_EXTRAS += -O0
USE_LIBSTDCPP := 1

# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD
Expand Down
Expand Up @@ -2,7 +2,7 @@ LEVEL = ../../../../../make

CXX_SOURCES := main.cpp

CFLAGS_EXTRAS := -O0
CFLAGS_EXTRAS += -O0
USE_LIBSTDCPP := 1

include $(LEVEL)/Makefile.rules
Expand Up @@ -6,7 +6,7 @@ CXX_SOURCES := main.cpp
# targets. Other targets do not, which causes this test to fail.
# This flag enables FullDebugInfo for all targets.
ifneq (,$(findstring clang,$(CC)))
CFLAGS_EXTRAS := -fno-limit-debug-info
CFLAGS_EXTRAS += -fno-limit-debug-info
endif

include $(LEVEL)/Makefile.rules
Expand Up @@ -5,7 +5,7 @@ CXX_SOURCES := main.cpp
# Workaround for llvm.org/pr16214: clang doesn't emit structure definition DWARF
# information without the flag below.
ifneq (,$(findstring clang,$(CC)))
CFLAGS_EXTRAS := -fno-limit-debug-info
CFLAGS_EXTRAS += -fno-limit-debug-info
endif

include $(LEVEL)/Makefile.rules
Expand Up @@ -6,7 +6,7 @@ CXX_SOURCES := main.cpp
# targets. Other targets do not, which causes this test to fail.
# This flag enables FullDebugInfo for all targets.
ifneq (,$(findstring clang,$(CC)))
CFLAGS_EXTRAS := -fno-limit-debug-info
CFLAGS_EXTRAS += -fno-limit-debug-info
endif

include $(LEVEL)/Makefile.rules
Expand Up @@ -6,7 +6,7 @@ CXXFLAGS += -std=c++11
# targets. Other targets do not, which causes this test to fail.
# This flag enables FullDebugInfo for all targets.
ifneq (,$(findstring clang,$(CC)))
CFLAGS_EXTRAS := -fno-limit-debug-info
CFLAGS_EXTRAS += -fno-limit-debug-info
endif

include $(LEVEL)/Makefile.rules
2 changes: 1 addition & 1 deletion lldb/test/lang/cpp/stl/Makefile
Expand Up @@ -9,7 +9,7 @@ clean: OBJECTS+=$(wildcard main.d.*)
# targets. Other targets do not, which causes this test to fail.
# This flag enables FullDebugInfo for all targets.
ifneq (,$(findstring clang,$(CC)))
CFLAGS_EXTRAS := -fno-limit-debug-info
CFLAGS_EXTRAS += -fno-limit-debug-info
endif

include $(LEVEL)/Makefile.rules
2 changes: 1 addition & 1 deletion lldb/test/make/Makefile.rules
Expand Up @@ -14,7 +14,7 @@
#
# Also might be of interest:
# FRAMEWORK_INCLUDES (Darwin only) :=
# CFLAGS_EXTRAS :=
# CFLAGS_EXTRAS +=
# LD_EXTRAS :=
# SPLIT_DEBUG_SYMBOLS := YES
#
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/python_api/lldbutil/iter/Makefile
@@ -1,6 +1,6 @@
LEVEL = ../../../make

CFLAGS_EXTRAS := -D__STDC_LIMIT_MACROS
CFLAGS_EXTRAS += -D__STDC_LIMIT_MACROS
ENABLE_THREADS := YES
CXX_SOURCES := main.cpp
MAKE_DSYM := NO
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/python_api/lldbutil/process/Makefile
@@ -1,6 +1,6 @@
LEVEL = ../../../make

CFLAGS_EXTRAS := -D__STDC_LIMIT_MACROS
CFLAGS_EXTRAS += -D__STDC_LIMIT_MACROS
ENABLE_THREADS := YES
CXX_SOURCES := main.cpp
MAKE_DSYM :=NO
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/python_api/module_section/Makefile
@@ -1,6 +1,6 @@
LEVEL = ../../make

CFLAGS_EXTRAS := -D__STDC_LIMIT_MACROS
CFLAGS_EXTRAS += -D__STDC_LIMIT_MACROS
ENABLE_THREADS := YES
CXX_SOURCES := main.cpp b.cpp c.cpp
MAKE_DSYM :=NO
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/python_api/sbvalue_persist/Makefile
Expand Up @@ -9,7 +9,7 @@ clean: OBJECTS+=no_synth
# targets. Other targets do not, which causes this test to fail.
# This flag enables FullDebugInfo for all targets.
ifneq (,$(findstring clang,$(CC)))
CFLAGS_EXTRAS := -fno-limit-debug-info
CFLAGS_EXTRAS += -fno-limit-debug-info
endif

include $(LEVEL)/Makefile.rules
2 changes: 1 addition & 1 deletion lldb/test/python_api/value_var_update/Makefile
@@ -1,7 +1,7 @@
LEVEL = ../../make

C_SOURCES := main.c
CFLAGS_EXTRAS := -std=c99
CFLAGS_EXTRAS += -std=c99
# See TestHelloWorld.py, which specifies the executable name with a dictionary.
EXE := hello_world

Expand Down
2 changes: 1 addition & 1 deletion lldb/test/tools/lldb-server/Makefile
@@ -1,6 +1,6 @@
LEVEL = ../../make

CFLAGS_EXTRAS := -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS
CFLAGS_EXTRAS += -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS
ENABLE_THREADS := YES
CXX_SOURCES := main.cpp
MAKE_DSYM :=NO
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/tools/lldb-server/inferior-crash/Makefile
@@ -1,6 +1,6 @@
LEVEL = ../../../make

CFLAGS_EXTRAS := -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -std=c++11
CFLAGS_EXTRAS += -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -std=c++11
# LD_EXTRAS := -lpthread
CXX_SOURCES := main.cpp
MAKE_DSYM :=NO
Expand Down

0 comments on commit 666a986

Please sign in to comment.