diff options
author | Ian Rogers <irogers@google.com> | 2014-03-11 14:42:37 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-03-11 14:42:37 -0700 |
commit | 2bb9d97b7dd35f78e67c3a774f2029c22b4fbb0b (patch) | |
tree | bf33eb4f5470469615a0f04d073d120ef48ffe38 | |
parent | d219db0be93109d1851cc03eb972cdc42c83f0bb (diff) | |
download | mclinker-2bb9d97b7dd35f78e67c3a774f2029c22b4fbb0b.tar.gz |
Work-around OS flex differences.
Linux flex generates declarations with int vs Darwin with size_t.
Switch host build to clang for better error messages. Disable Werror
until errors are dealt with.
Change-Id: I0abc8923dd1e57d55e8f318c7d1fcf8f8c975571
-rw-r--r-- | include/mcld/Script/FlexLexer.h | 11 | ||||
-rw-r--r-- | mcld-device-build.mk | 4 | ||||
-rw-r--r-- | mcld-host-build.mk | 10 |
3 files changed, 20 insertions, 5 deletions
diff --git a/include/mcld/Script/FlexLexer.h b/include/mcld/Script/FlexLexer.h index f09ab20..d7d8001 100644 --- a/include/mcld/Script/FlexLexer.h +++ b/include/mcld/Script/FlexLexer.h @@ -139,8 +139,15 @@ public: virtual int yywrap(); protected: - virtual int LexerInput( char* buf, int max_size ); - virtual void LexerOutput( const char* buf, int size ); +// BEGIN android-modified: work around flex differences on Darwin and Linux +#if !defined(DARWIN_FLEX) + virtual int LexerInput( char* buf, int max_size ); + virtual void LexerOutput( const char* buf, int size ); +#else + virtual size_t LexerInput( char* buf, size_t max_size ); + virtual void LexerOutput( const char* buf, size_t size ); +#endif +// END android-modified virtual void LexerError( const char* msg ); void yyunput( int c, char* buf_ptr ); diff --git a/mcld-device-build.mk b/mcld-device-build.mk index 87bc0b7..744edcf 100644 --- a/mcld-device-build.mk +++ b/mcld-device-build.mk @@ -23,6 +23,10 @@ ifeq ($(MCLD_ENABLE_ASSERTION),true) -UNDEBUG endif +ifeq ($(HOST_OS),darwin) +LOCAL_CFLAGS += -DDARWIN_FLEX=1 +endif + # Make sure bionic is first so we can include system headers. LOCAL_C_INCLUDES := \ bionic \ diff --git a/mcld-host-build.mk b/mcld-host-build.mk index a5736b7..ebc4dea 100644 --- a/mcld-host-build.mk +++ b/mcld-host-build.mk @@ -6,9 +6,7 @@ LOCAL_CFLAGS := \ LOCAL_CPPFLAGS := \ $(LOCAL_CPPFLAGS) \ - -Wall \ - -Wno-unused-parameter \ - -Werror + -Wall ifeq ($(MCLD_ENABLE_ASSERTION),true) LOCAL_CPPFLAGS += \ @@ -16,6 +14,12 @@ ifeq ($(MCLD_ENABLE_ASSERTION),true) -UNDEBUG endif +LOCAL_CLANG := true + +ifeq ($(HOST_OS),darwin) +LOCAL_CFLAGS += -DDARWIN_FLEX=1 +endif + LOCAL_C_INCLUDES := \ $(MCLD_ROOT_PATH)/include \ $(LLVM_ROOT_PATH) \ |