Bug 33173 - препроцессору не передается -fstack-protector => .gch файлы не включаются
Summary: препроцессору не передается -fstack-protector => .gch файлы не включаются
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: gcc7 (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Nobody's working on this, feel free to take it
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-26 05:15 MSK by Big Benis
Modified: 2018-07-13 04:31 MSK (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Big Benis 2017-02-26 05:15:32 MSK
джисиси очень сильно глючит, в результате чего не проходит тест свит у сосикеша.
В частности сосикеш выполнят такой тест: компилирует заголовочный файл в .gch, удаляет оригинал, после чего скомпилированный заголовок должен в определенных случаях включаться препроцессором эз из.  А он не включается!

$ touch foo.h
$ gcc -c foo.h                                         
$ rm foo.h

$ gcc-6 -Winvalid-pch -fpch-preprocess -include foo.h -E - </dev/null
# 1 "<stdin>"                                                                              
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
cc1: warning: ./foo.h.gch: not used because `__SSP__' not defined [-Winvalid-pch]
cc1: error: one or more PCH files were found, but they were invalid
cc1: fatal error: foo.h: No such file or directory
compilation terminated.

А если передать препроцессору -fstack-protector, то включается нормально:

$ gcc-6 -fstack-protector -Winvalid-pch -fpch-preprocess -include foo.h -E - </dev/null               1
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
#pragma GCC pch_preprocess "./foo.h.gch"
# 1 "<stdin>"

И действительно, разница на один этот дифайн __SSP__:

$ diff -U1 <(cpp  -dM </dev/null) <(cpp -fstack-protector -dM </dev/null)                                                   @@ -198,2 +198,3 @@
 #define __INT_LEAST8_MAX__ 0x7f
+#define __SSP__ 1
 #define __SIZEOF_INT128__ 16

Получается интеграция -fstack-protector в джисиси не совсем симлис.