Skip to content

Commit

Permalink
Bug 1618782 - Use winchecksec on Windows cross builds too. r=rstewart
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Mar 27, 2020
1 parent 9edf159 commit 8b7e020
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
5 changes: 2 additions & 3 deletions browser/config/mozconfigs/win32/common-win32
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ mk_add_options "export PATH=${VSPATH}/VC/bin/Hostx64/x86:${MOZ_FETCHES_DIR}/nsis

unset VC_PATH

else # ! Linux
fi

export WINCHECKSEC="${MOZ_FETCHES_DIR}/winchecksec/winchecksec.exe"
if [ ! -f "${WINCHECKSEC}" ]; then
unset WINCHECKSEC
fi

fi

export PDBSTR="${MOZ_FETCHES_DIR}/pdbstr/pdbstr.exe"
if [ -f "${PDBSTR}" ]; then
chmod +x "${PDBSTR}"
Expand Down
11 changes: 8 additions & 3 deletions browser/config/mozconfigs/win64-aarch64/common-win64
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@ mk_add_options "export WINEPATH=${VSPATH}/VC/bin/Hostx64/x64"

unset VC_PATH

else # ! Linux
fi

export WINCHECKSEC="${MOZ_FETCHES_DIR}/winchecksec/winchecksec.exe"
if [ ! -f "${WINCHECKSEC}" ]; then
unset WINCHECKSEC
fi

fi

export PDBSTR="${MOZ_FETCHES_DIR}/pdbstr/pdbstr.exe"
if [ -f "${PDBSTR}" ]; then
chmod +x "${PDBSTR}"
else
unset PDBSTR
fi

# Temporary signal to toolchain.configure that our compiler is patched to
# support CFG, until such support can be assumed.
if test -z "$USE_ARTIFACT"; then
ac_add_options --enable-hardening
fi
5 changes: 2 additions & 3 deletions browser/config/mozconfigs/win64/common-win64
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ mk_add_options "export PATH=${VSPATH}/VC/bin/Hostx64/x64:${MOZ_FETCHES_DIR}/nsis

unset VC_PATH

else # ! Linux
fi

export WINCHECKSEC="${MOZ_FETCHES_DIR}/winchecksec/winchecksec.exe"
if [ ! -f "${WINCHECKSEC}" ]; then
unset WINCHECKSEC
fi

fi

export PDBSTR="${MOZ_FETCHES_DIR}/pdbstr/pdbstr.exe"
if [ -f "${PDBSTR}" ]; then
chmod +x "${PDBSTR}"
Expand Down
8 changes: 7 additions & 1 deletion build/win32/autowinchecksec.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@
"not set, can't check DEP/ASLR etc. status.")
sys.exit(1)

wine = buildconfig.substs.get('WINE')
if wine:
cmd = [wine, winchecksec_path]
else:
cmd = [winchecksec_path]

try:
result = subprocess.check_output([winchecksec_path, '-j', binary_path],
result = subprocess.check_output(cmd + ['-j', binary_path],
universal_newlines=True)

except subprocess.CalledProcessError as e:
Expand Down
2 changes: 1 addition & 1 deletion config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ syms:: $(2)
$(2): $(1)
ifdef MOZ_CRASHREPORTER
$$(call py3_action,dumpsymbols,$$(abspath $$<) $$(abspath $$@) $$(DUMP_SYMBOLS_FLAGS))
ifeq ($(HOST_OS_ARCH),WINNT)
ifeq ($(OS_ARCH),WINNT)
ifdef WINCHECKSEC
$$(PYTHON3) $$(topsrcdir)/build/win32/autowinchecksec.py $$<
endif # WINCHECKSEC
Expand Down
2 changes: 2 additions & 0 deletions taskcluster/ci/instrumented-build/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ jobs:
- linux64-dump-syms
- linux64-wine
- linux64-liblowercase
- win64-winchecksec
fetch:
- nsis-3.01-win
- upx-3.95-win
Expand Down Expand Up @@ -244,6 +245,7 @@ jobs:
- linux64-dump-syms
- linux64-wine
- linux64-liblowercase
- win64-winchecksec
fetch:
- nsis-3.01-win
- upx-3.95-win
2 changes: 1 addition & 1 deletion toolkit/moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@ def allow_missing_winchecksec(automation, c_compiler):

check_prog('WINCHECKSEC', ['winchecksec.exe'], paths=toolchain_search_path,
allow_missing=allow_missing_winchecksec,
when=compile_environment & target_is_windows & host_is_windows)
when=compile_environment & target_is_windows)

# Fork server
@depends(target, build_project)
Expand Down

0 comments on commit 8b7e020

Please sign in to comment.