Mercurial > hgrepos > Python > libs > ConfigMix
comparison windows-dev/Configure.py @ 590:91e74fb1ea90
Enable the stack-protector (or /GS)
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 09 Jan 2022 14:14:54 +0100 |
| parents | 48e79cbd2481 |
| children | 9107ff0c5a63 |
comparison
equal
deleted
inserted
replaced
| 589:87db5a732797 | 590:91e74fb1ea90 |
|---|---|
| 276 | 276 |
| 277 ccflags.append("/Zi") | 277 ccflags.append("/Zi") |
| 278 ccflags.append("/MD") # link to dll runtime | 278 ccflags.append("/MD") # link to dll runtime |
| 279 #ccflags.append("/EHsc") # no C++ here | 279 #ccflags.append("/EHsc") # no C++ here |
| 280 ccflags.append("/Gy") # enable function level linking | 280 ccflags.append("/Gy") # enable function level linking |
| 281 ccflags.append("/GS") # enable the stack protector -fstack-protector | |
| 281 ccflags.append("/O2") | 282 ccflags.append("/O2") |
| 282 | 283 |
| 283 # XXX TBD machine | 284 # XXX TBD machine |
| 284 if tool.clang: | 285 if tool.clang: |
| 285 ccflags.append("--target=x86_64-pc-windows-msvc") | 286 ccflags.append("--target=x86_64-pc-windows-msvc") |
| 316 | 317 |
| 317 if tool.clang: # || tool.gcc | 318 if tool.clang: # || tool.gcc |
| 318 ccflags.append("-ffunction-sections") | 319 ccflags.append("-ffunction-sections") |
| 319 ccflags.append("-fdata-sections") | 320 ccflags.append("-fdata-sections") |
| 320 ccflags.append("-fno-strict-aliasing") | 321 ccflags.append("-fno-strict-aliasing") |
| 321 | 322 ccflags.append("-fstack-protector") |
| 322 if tool.clang: | |
| 323 ccflags.append("-faddrsig") # use with --icf=all/safe when linking | 323 ccflags.append("-faddrsig") # use with --icf=all/safe when linking |
| 324 | 324 |
| 325 ldflags.append("-shared") | 325 ldflags.append("-shared") |
| 326 ldflags.append("-Wl,-z,relro,-z,now") | 326 ldflags.append("-Wl,-z,relro,-z,now") |
| 327 ldflags.append("-Wl,--build-id=sha1") | 327 ldflags.append("-Wl,--build-id=sha1") |
