Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | # |
michael@0 | 2 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 5 | |
michael@0 | 6 | INTERNAL_TOOLS = 1 |
michael@0 | 7 | |
michael@0 | 8 | OS_CXXFLAGS := $(filter-out -fno-exceptions,$(OS_CXXFLAGS)) -fexceptions |
michael@0 | 9 | |
michael@0 | 10 | WRAP_LDFLAGS= |
michael@0 | 11 | |
michael@0 | 12 | include $(topsrcdir)/config/rules.mk |
michael@0 | 13 | |
michael@0 | 14 | test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX): %$(DLL_SUFFIX): %.$(OBJ_SUFFIX) elfhack |
michael@0 | 15 | $(MKSHLIB) $(LDFLAGS) $< -nostartfiles |
michael@0 | 16 | @echo === |
michael@0 | 17 | @echo === If you get failures below, please file a bug describing the error |
michael@0 | 18 | @echo === and your environment \(compiler and linker versions\), and use |
michael@0 | 19 | @echo === --disable-elf-hack until this is fixed. |
michael@0 | 20 | @echo === |
michael@0 | 21 | # Fail if the library doesn't have $(DT_TYPE) .dynamic info |
michael@0 | 22 | $(TOOLCHAIN_PREFIX)readelf -d $@ | grep '($(DT_TYPE))' |
michael@0 | 23 | @rm -f $@.bak |
michael@0 | 24 | $(CURDIR)/elfhack -b -f $@ |
michael@0 | 25 | # Fail if the backup file doesn't exist |
michael@0 | 26 | [ -f '$@.bak' ] |
michael@0 | 27 | # Fail if the new library doesn't contain less relocations |
michael@0 | 28 | [ $$($(TOOLCHAIN_PREFIX)objdump -R $@.bak | wc -l) -gt $$(objdump -R $@ | wc -l) ] |
michael@0 | 29 | |
michael@0 | 30 | test-array$(DLL_SUFFIX): DT_TYPE=INIT_ARRAY |
michael@0 | 31 | test-ctors$(DLL_SUFFIX): DT_TYPE=INIT |
michael@0 | 32 | |
michael@0 | 33 | .PRECIOUS: test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX) |
michael@0 | 34 | |
michael@0 | 35 | GARBAGE += test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX) test-array$(DLL_SUFFIX).bak test-ctors$(DLL_SUFFIX).bak |
michael@0 | 36 | |
michael@0 | 37 | ifndef CROSS_COMPILE |
michael@0 | 38 | ifdef COMPILE_ENVIRONMENT |
michael@0 | 39 | libs:: test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX) |
michael@0 | 40 | |
michael@0 | 41 | dummy: dummy.$(OBJ_SUFFIX) |
michael@0 | 42 | $(CC) -o $@ $^ $(LDFLAGS) |
michael@0 | 43 | |
michael@0 | 44 | libs:: dummy |
michael@0 | 45 | # Will either crash or return exit code 1 if elfhack is broken |
michael@0 | 46 | LD_PRELOAD=$(CURDIR)/test-array$(DLL_SUFFIX) $(CURDIR)/dummy |
michael@0 | 47 | LD_PRELOAD=$(CURDIR)/test-ctors$(DLL_SUFFIX) $(CURDIR)/dummy |
michael@0 | 48 | |
michael@0 | 49 | GARBAGE += dummy |
michael@0 | 50 | endif |
michael@0 | 51 | endif |