diff options
author | Florian Weimer <fweimer@redhat.com> | 2016-06-10 10:46:05 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2016-06-10 10:46:05 +0200 |
commit | 2ba3cfa1607c36613f3b30fb1ae4ec530245ce64 (patch) | |
tree | 4c215fe75ef1c016943e36821137257480097e01 /malloc/Makefile | |
parent | f00faa4a43706d85ad8d4d2c970d3f52f0f63bfb (diff) | |
download | glibc-2ba3cfa1607c36613f3b30fb1ae4ec530245ce64.tar.gz glibc-2ba3cfa1607c36613f3b30fb1ae4ec530245ce64.tar.xz glibc-2ba3cfa1607c36613f3b30fb1ae4ec530245ce64.zip |
malloc: Remove __malloc_initialize_hook from the API [BZ #19564]
__malloc_initialize_hook is interposed by application code, so the usual approach to define a compatibility symbol does not work. This commit adds a new mechanism based on #pragma GCC poison in <stdc-predef.h>.
Diffstat (limited to 'malloc/Makefile')
-rw-r--r-- | malloc/Makefile | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/malloc/Makefile b/malloc/Makefile index fa1730ecb7..91eb17dd7a 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -115,6 +115,20 @@ endif include ../Rules +# Support references to removed APIs. We use #pragma GCC poison in +# <stdc-predef.h> to make it difficult to reference them. For select +# source files, we work around this poisoning by defining a macro on +# the command line (which is processed before <stdc-predef.h> and can +# therefore use tokens poisoned later). +poisoned_apis = \ + __malloc_initialize_hook \ + +unpoisoned_api_defines := \ + $(foreach sym,$(poisoned_apis), \ + $(patsubst %,-Dold%, $(sym))=$(sym)) +CPPFLAGS-malloc.c = $(unpoisoned_api_defines) +CPPFLAGS-mcheck-init.c = $(unpoisoned_api_defines) + CFLAGS-mcheck-init.c = $(PIC-ccflag) CFLAGS-obstack.c = $(uses-callbacks) |