Compare commits
924
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b39d963afe | ||
|
|
9fbfc408a7 | ||
|
|
87e3d17721 | ||
|
|
13c1745f54 | ||
|
|
fb23669e29 | ||
|
|
d7e1a2fb6e | ||
|
|
054dedf3e5 | ||
|
|
6e0781b7ab | ||
|
|
ea51a511e0 | ||
|
|
99a676dc8a | ||
|
|
ba0ba4e869 | ||
|
|
23ba0dd94c | ||
|
|
c4132e6e37 | ||
|
|
35a54fd1e8 | ||
|
|
d3a1413453 | ||
|
|
ee8481e11d | ||
|
|
a9bca26633 | ||
|
|
3db4c14c0f | ||
|
|
67ecea3e25 | ||
|
|
779ac2fd7e | ||
|
|
175645e74b | ||
|
|
2fa7835e8a | ||
|
|
6f4bca13bd | ||
|
|
0d5e2fae31 | ||
|
|
9df6d8064f | ||
|
|
701ff12918 | ||
|
|
e4c7fa8810 | ||
|
|
dd4e1b1b30 | ||
|
|
8b39bafb50 | ||
|
|
dabc26f1c6 | ||
|
|
5f01e6c68b | ||
|
|
83312980ac | ||
|
|
cf979e773a | ||
|
|
b3f1d81f35 | ||
|
|
925c79e0bd | ||
|
|
f508cf14b7 | ||
|
|
9804dc2e58 | ||
|
|
02582243bb | ||
|
|
0138c0596e | ||
|
|
95b6d96c01 | ||
|
|
7a172d5b55 | ||
|
|
1be99f2e95 | ||
|
|
49188baf81 | ||
|
|
9d9d47f04f | ||
|
|
192601326e | ||
|
|
ce5a83b978 | ||
|
|
60b2b2dd05 | ||
|
|
feae03d4f1 | ||
|
|
da07c7ff06 | ||
|
|
67e102e4ba | ||
|
|
0e65b1bff8 | ||
|
|
550dfa02f0 | ||
|
|
716e6c10eb | ||
|
|
491c6cc507 | ||
|
|
c5dc9bdba7 | ||
|
|
5301436178 | ||
|
|
1d85c7b84c | ||
|
|
b74bf01597 | ||
|
|
7c108d2a16 | ||
|
|
f713766241 | ||
|
|
1e498ea62a | ||
|
|
ef4b9720e3 | ||
|
|
2b63ae0afb | ||
|
|
b592d8ca65 | ||
|
|
c938899431 | ||
|
|
c6c8172efa | ||
|
|
b861f929cd | ||
|
|
3505466fbc | ||
|
|
a35266bb10 | ||
|
|
3d6da2e4da | ||
|
|
21be5e8304 | ||
|
|
095f076659 | ||
|
|
046bcb7728 | ||
|
|
d48f90785a | ||
|
|
ce5a8d48b2 | ||
|
|
987d9c735d | ||
|
|
51b3c87423 | ||
|
|
535d44e7de | ||
|
|
ee072e2d82 | ||
|
|
295c3e092a | ||
|
|
ab4ff21b1e | ||
|
|
8957ce8c3b | ||
|
|
fb32c684ab | ||
|
|
7a06206b24 | ||
|
|
71f5d8dfc2 | ||
|
|
c4f44cbfd2 | ||
|
|
99ead15ee1 | ||
|
|
0638fd4c48 | ||
|
|
dc564efd8b | ||
|
|
5209932b48 | ||
|
|
799485b5c1 | ||
|
|
d2ce083552 | ||
|
|
758c056002 | ||
|
|
b856667d8f | ||
|
|
a1c77ff5f9 | ||
|
|
1be6257820 | ||
|
|
7f40954077 | ||
|
|
c26918dbca | ||
|
|
600067b749 | ||
|
|
bb9ab3a9b3 | ||
|
|
38c3a4b111 | ||
|
|
741ce3b36f | ||
|
|
47b6fbef2f | ||
|
|
364a567b67 | ||
|
|
5c0af3fbd9 | ||
|
|
9771426a39 | ||
|
|
a31244d28a | ||
|
|
ea5b42a1c2 | ||
|
|
9c777b2a6a | ||
|
|
eecc47a3e9 | ||
|
|
6d5778f6c2 | ||
|
|
9a30d85be0 | ||
|
|
0e3f710b86 | ||
|
|
e3dd04825d | ||
|
|
e91d2f7ba3 | ||
|
|
6ea553a178 | ||
|
|
00eb0ae306 | ||
|
|
75652ad9d3 | ||
|
|
7f40d19607 | ||
|
|
5b75d8c71f | ||
|
|
0921c2eaf1 | ||
|
|
9acbdf3175 | ||
|
|
bbb77258a6 | ||
|
|
35be4c17e5 | ||
|
|
f8077cee82 | ||
|
|
df7ad599f1 | ||
|
|
ad750c6e0d | ||
|
|
ddcb7397d0 | ||
|
|
5daf8e2648 | ||
|
|
4451373be6 | ||
|
|
4257ea2096 | ||
|
|
aff6137268 | ||
|
|
0b16bb567d | ||
|
|
cdb82a9153 | ||
|
|
80fea8781e | ||
|
|
3d349a2508 | ||
|
|
c4c135251a | ||
|
|
62102c17d0 | ||
|
|
d6b53de2e3 | ||
|
|
317db382fc | ||
|
|
1ad3f3b550 | ||
|
|
384462571b | ||
|
|
74586c0ead | ||
|
|
5ce37aea08 | ||
|
|
0d39be5065 | ||
|
|
ff29f3a7db | ||
|
|
215bc53a00 | ||
|
|
3df962da7a | ||
|
|
975b33952e | ||
|
|
8cf07bf2cf | ||
|
|
71010f6d73 | ||
|
|
39d62928cb | ||
|
|
047439a66f | ||
|
|
cca32f2610 | ||
|
|
8e0f2aa4c5 | ||
|
|
5f048bd53c | ||
|
|
77f9876a61 | ||
|
|
392318c1b8 | ||
|
|
05c583cced | ||
|
|
1ed23588a3 | ||
|
|
d486aae01c | ||
|
|
a52d8a761b | ||
|
|
01af1c2834 | ||
|
|
1b7d2781c5 | ||
|
|
791dfb0b62 | ||
|
|
c429bfa005 | ||
|
|
f57b1704e9 | ||
|
|
c36aeec04e | ||
|
|
9fc90003a8 | ||
|
|
f1e3b03575 | ||
|
|
17e3e1ae53 | ||
|
|
52ef925d7d | ||
|
|
5a49f4db09 | ||
|
|
492c5b46a0 | ||
|
|
e911489338 | ||
|
|
9edb856684 | ||
|
|
06c78cb134 | ||
|
|
d20a4806d9 | ||
|
|
c89e5ff737 | ||
|
|
8e8c6b053c | ||
|
|
d5a12b1f0f | ||
|
|
a6d89192ce | ||
|
|
959932fa6a | ||
|
|
89be40d875 | ||
|
|
948a46c3c1 | ||
|
|
49756113c3 | ||
|
|
f7690dc1b6 | ||
|
|
2e426c6f9b | ||
|
|
77b61a05ba | ||
|
|
0272a7de51 | ||
|
|
b65ae44275 | ||
|
|
95ba4c51b9 | ||
|
|
e96e183cad | ||
|
|
2864fa2bbf | ||
|
|
2f29590171 | ||
|
|
ce8475d6aa | ||
|
|
758b05e1f3 | ||
|
|
c813b146b6 | ||
|
|
c8616eb683 | ||
|
|
fdda093b86 | ||
|
|
c5f689d154 | ||
|
|
a4966a41d1 | ||
|
|
15ba1bfb91 | ||
|
|
38102885f5 | ||
|
|
5f2a577cff | ||
|
|
302b6f5c29 | ||
|
|
49cb19b409 | ||
|
|
d76de92428 | ||
|
|
0c7bf2ff3a | ||
|
|
35ee57697f | ||
|
|
455813ded6 | ||
|
|
eb709f2450 | ||
|
|
6e75a19cc1 | ||
|
|
d4fe8e365b | ||
|
|
709e3c5bfb | ||
|
|
88f4f32070 | ||
|
|
d94853c525 | ||
|
|
ca92b35948 | ||
|
|
58f51f009a | ||
|
|
9db916caa0 | ||
|
|
ede07e1eea | ||
|
|
0ab0fbe09f | ||
|
|
11f99b7d88 | ||
|
|
b73ad9e455 | ||
|
|
f43151c365 | ||
|
|
5ff16dfef6 | ||
|
|
471391afb8 | ||
|
|
12f0b3ce80 | ||
|
|
f5d5a9be19 | ||
|
|
2f52a22248 | ||
|
|
340a17d98f | ||
|
|
eda9b90f02 | ||
|
|
fae7e7a3df | ||
|
|
3bfc752cf3 | ||
|
|
1acb17b164 | ||
|
|
ed35fbc94d | ||
|
|
844ef18c0c | ||
|
|
21469fdb7e | ||
|
|
2928b2ecbc | ||
|
|
044c496fc5 | ||
|
|
5d56b2855d | ||
|
|
8a158f6fe8 | ||
|
|
f235a384db | ||
|
|
3930a95f9b | ||
|
|
ef66300eee | ||
|
|
e7551a4d33 | ||
|
|
9a80884957 | ||
|
|
bc0cf15634 | ||
|
|
5d5071573e | ||
|
|
69fdf24589 | ||
|
|
97f94c593e | ||
|
|
c9b6e30e76 | ||
|
|
386dec5c1a | ||
|
|
9ff62bc5da | ||
|
|
d372f6f000 | ||
|
|
26d23c674d | ||
|
|
a7e49ff158 | ||
|
|
24b2c2f799 | ||
|
|
fc18a8cf75 | ||
|
|
63f921fbac | ||
|
|
0a5bbce93c | ||
|
|
eb6b3d22fe | ||
|
|
bfce4aae18 | ||
|
|
30076c1acc | ||
|
|
eedbcf05d3 | ||
|
|
da846f1441 | ||
|
|
25b2af90c7 | ||
|
|
e024767d05 | ||
|
|
3ff97e906c | ||
|
|
99c649cb5b | ||
|
|
e6f9e31426 | ||
|
|
d25edc898b | ||
|
|
5c65c3e95c | ||
|
|
f468d3ed7e | ||
|
|
914fda97fd | ||
|
|
c300dde6a4 | ||
|
|
5f6afd3b39 | ||
|
|
278dfcbbe8 | ||
|
|
afa759414d | ||
|
|
dbb9cc144a | ||
|
|
e917f5f013 | ||
|
|
8fe97c5840 | ||
|
|
ca5b16d6a4 | ||
|
|
12ebd049ff | ||
|
|
388a1bee06 | ||
|
|
3e198bac24 | ||
|
|
3b01bb6faf | ||
|
|
6f34220b3a | ||
|
|
7a0cfe6da4 | ||
|
|
0acf0c9831 | ||
|
|
70d797b6bc | ||
|
|
0a2dbea03d | ||
|
|
d2dda897da | ||
|
|
61ad82401b | ||
|
|
aabb7dcbdc | ||
|
|
a3a5a35de0 | ||
|
|
83e60ee431 | ||
|
|
65e755225d | ||
|
|
2054a4ff14 | ||
|
|
fcc96b0f2d | ||
|
|
eb2c5983f2 | ||
|
|
d3b439ae2d | ||
|
|
791e7d2242 | ||
|
|
9117c61527 | ||
|
|
44c74fc28f | ||
|
|
f614c9df88 | ||
|
|
19df13804c | ||
|
|
fcdba1bd8a | ||
|
|
b541254994 | ||
|
|
6caeba319e | ||
|
|
ed03333008 | ||
|
|
9b18e344dd | ||
|
|
ef9cd3d784 | ||
|
|
c8f54ddcf4 | ||
|
|
7581bc0858 | ||
|
|
23b5c7d3a1 | ||
|
|
76ed56905a | ||
|
|
6cd310a2e2 | ||
|
|
6dd916d6c7 | ||
|
|
b8129fe127 | ||
|
|
1c678fa3c5 | ||
|
|
7cb729cbe3 | ||
|
|
186b3ce912 | ||
|
|
e654a995e6 | ||
|
|
934c5c2aa5 | ||
|
|
e802723505 | ||
|
|
1c08fcf46d | ||
|
|
c44c78d2de | ||
|
|
bfdda7a6ab | ||
|
|
5ef2c055a2 | ||
|
|
0685ccaee7 | ||
|
|
6fb1fd4f97 | ||
|
|
e885f6a725 | ||
|
|
a0fa6ebe88 | ||
|
|
9660d13ea2 | ||
|
|
e80811fa0b | ||
|
|
31ac94a4fe | ||
|
|
64166249da | ||
|
|
a3310dbefc | ||
|
|
d36982c01f | ||
|
|
e764458083 | ||
|
|
fa0dae0838 | ||
|
|
eb6ab4c641 | ||
|
|
b2495a917b | ||
|
|
6aba5f73d4 | ||
|
|
f05438b4e4 | ||
|
|
3d182a6f07 | ||
|
|
1622e2b075 | ||
|
|
e5d88d4de7 | ||
|
|
99b398a7e5 | ||
|
|
f870333b99 | ||
|
|
4b71aa8525 | ||
|
|
ef60968c20 | ||
|
|
9a6d507fbb | ||
|
|
4c91a72ff1 | ||
|
|
12487a1efa | ||
|
|
c818f9f054 | ||
|
|
d7a22e3636 | ||
|
|
0fbe7ee76c | ||
|
|
39883062ed | ||
|
|
a224919712 | ||
|
|
3237f58244 | ||
|
|
b165dd2c91 | ||
|
|
4c9b0de4f5 | ||
|
|
e7823b1698 | ||
|
|
d96d44b90e | ||
|
|
6d1af1b891 | ||
|
|
301f732c5c | ||
|
|
d931b61091 | ||
|
|
163564f0e6 | ||
|
|
4f8e3489e9 | ||
|
|
48c4deaf16 | ||
|
|
989af693b7 | ||
|
|
5b0c90e31e | ||
|
|
b0552ee23b | ||
|
|
fdec907384 | ||
|
|
1eb6b7cbd7 | ||
|
|
d06845725b | ||
|
|
fcb508a3e9 | ||
|
|
63247b469f | ||
|
|
017f0b4c3e | ||
|
|
417b673286 | ||
|
|
c0ba30c7e6 | ||
|
|
de21e03333 | ||
|
|
efc7fc9c57 | ||
|
|
8396a60cf3 | ||
|
|
85846b592b | ||
|
|
61bf12bc88 | ||
|
|
a84393aa6d | ||
|
|
f5759c1e06 | ||
|
|
bf0a5f0a21 | ||
|
|
6caddcb873 | ||
|
|
e100b18aca | ||
|
|
ceefc5d8ec | ||
|
|
6ae591471a | ||
|
|
19c7d1a375 | ||
|
|
bac4792f27 | ||
|
|
0b9acf52a4 | ||
|
|
4baa73c3bc | ||
|
|
2cc6ae4a9d | ||
|
|
be5ae77c0a | ||
|
|
2cff732e2d | ||
|
|
bad59f2ea6 | ||
|
|
73bd400ec0 | ||
|
|
44ee4d924d | ||
|
|
db394a8af5 | ||
|
|
7fc0216fc9 | ||
|
|
33dcf5fba6 | ||
|
|
b93a6af1d8 | ||
|
|
5f24a4447d | ||
|
|
1901060d4d | ||
|
|
258b6b6bdf | ||
|
|
2cbff69bea | ||
|
|
006a0ab42f | ||
|
|
4b95925e92 | ||
|
|
4d41a8b41d | ||
|
|
a4dc750a3d | ||
|
|
5c2e83f051 | ||
|
|
75cd812fa3 | ||
|
|
988aef6646 | ||
|
|
91169f3da6 | ||
|
|
1c71d748f5 | ||
|
|
d1c97617d6 | ||
|
|
2a951d962d | ||
|
|
6666f8a984 | ||
|
|
8297ed30b7 | ||
|
|
083e21bcef | ||
|
|
26304f0ef4 | ||
|
|
5da25bc8ff | ||
|
|
0c63ff041c | ||
|
|
ab99e27262 | ||
|
|
da9a4f99b7 | ||
|
|
7a92fc03d4 | ||
|
|
25d7b699c8 | ||
|
|
7bce1ef049 | ||
|
|
2f9ef89189 | ||
|
|
672f15b68b | ||
|
|
7589ce632a | ||
|
|
27b59a47bf | ||
|
|
5584b04491 | ||
|
|
739970777f | ||
|
|
4c4d332df4 | ||
|
|
204b7b4ef8 | ||
|
|
04d73a5824 | ||
|
|
157ecd3d67 | ||
|
|
db25689dfd | ||
|
|
ddada76032 | ||
|
|
cbb31df5a6 | ||
|
|
4782ffd01f | ||
|
|
b031017414 | ||
|
|
15c4e9f725 | ||
|
|
6792641fd1 | ||
|
|
b62a89e63e | ||
|
|
fd7b2bb9ba | ||
|
|
5427d7da1a | ||
|
|
c615d769a5 | ||
|
|
ec474dbba3 | ||
|
|
c9ecca715d | ||
|
|
b31e799f40 | ||
|
|
bc21aed803 | ||
|
|
ae4e10441d | ||
|
|
0d97d66326 | ||
|
|
bef25f70d1 | ||
|
|
5e0ec9cd58 | ||
|
|
3461741705 | ||
|
|
0d6a85496e | ||
|
|
483d9d68f7 | ||
|
|
d6efa94dd4 | ||
|
|
45d3d6f008 | ||
|
|
b8e71b7eba | ||
|
|
31df88c66b | ||
|
|
8b2710cd90 | ||
|
|
e7f1ac5401 | ||
|
|
9fe445af36 | ||
|
|
196d555092 | ||
|
|
f983270531 | ||
|
|
d93180dbef | ||
|
|
57d301749c | ||
|
|
9b30cd6a46 | ||
|
|
534a7e1b5d | ||
|
|
3a92a1927a | ||
|
|
c7145b2961 | ||
|
|
eef97ce49d | ||
|
|
47f8f5fa53 | ||
|
|
2eeee445b9 | ||
|
|
f205650259 | ||
|
|
c8dde6e21f | ||
|
|
b7d1905f30 | ||
|
|
dc0121d4ec | ||
|
|
fdbbc774a9 | ||
|
|
585c08bad5 | ||
|
|
d7312852ef | ||
|
|
15d2dc6f97 | ||
|
|
de9bacf81e | ||
|
|
0ba6ed675d | ||
|
|
c1a92c993c | ||
|
|
60305a7cf5 | ||
|
|
536da3687b | ||
|
|
5304b91935 | ||
|
|
d5e494ddc2 | ||
|
|
967d1421e0 | ||
|
|
c775d2afd1 | ||
|
|
12b5b1ebec | ||
|
|
c33e5d823e | ||
|
|
c1e4579d3e | ||
|
|
1ef326fb4c | ||
|
|
a95ce42a81 | ||
|
|
f76781ccb7 | ||
|
|
965ad4f4c7 | ||
|
|
3c5f76f5dd | ||
|
|
d87aed4903 | ||
|
|
ccee38fcab | ||
|
|
3579c4086d | ||
|
|
b786a5a157 | ||
|
|
1e72ef48c7 | ||
|
|
1ecdae5ee4 | ||
|
|
e5543e368b | ||
|
|
1237ef25f7 | ||
|
|
ffc361b821 | ||
|
|
826e23de0a | ||
|
|
8963f2e6f7 | ||
|
|
0587f1cd8a | ||
|
|
c886f41ead | ||
|
|
a6d320df58 | ||
|
|
a31d168635 | ||
|
|
a88c8c918c | ||
|
|
95b694bda3 | ||
|
|
9b4807d874 | ||
|
|
7bfd1a8788 | ||
|
|
e454709328 | ||
|
|
842db355c1 | ||
|
|
2e9c8a4cf7 | ||
|
|
fdff56f4ec | ||
|
|
106f5808ee | ||
|
|
f996de4076 | ||
|
|
a6c9c353ff | ||
|
|
9ba8b8fe2c | ||
|
|
f898709b68 | ||
|
|
ec65cb9968 | ||
|
|
89f929565d | ||
|
|
1ff598acd8 | ||
|
|
6c07834748 | ||
|
|
bab93f7c58 | ||
|
|
0175f00236 | ||
|
|
08c9e0caaa | ||
|
|
43a87e5c5c | ||
|
|
8d927d43bb | ||
|
|
c7c2b2d02a | ||
|
|
733823e198 | ||
|
|
7840c9e342 | ||
|
|
50d682901e | ||
|
|
b3a9087977 | ||
|
|
fe9f90a820 | ||
|
|
2060145b64 | ||
|
|
1d702fd28f | ||
|
|
1a09684c76 | ||
|
|
c4c14f006a | ||
|
|
114fdc0a68 | ||
|
|
34de4c899f | ||
|
|
1f942ba22a | ||
|
|
20f0418934 | ||
|
|
d1ef0ded0e | ||
|
|
c7f5488b79 | ||
|
|
a83aa92d5a | ||
|
|
e06ca9853d | ||
|
|
a4c1c62220 | ||
|
|
caf386d8ec | ||
|
|
7c01831c90 | ||
|
|
fb902ea172 | ||
|
|
b8d61323f8 | ||
|
|
d4df6dc96b | ||
|
|
ffbe7a6c50 | ||
|
|
6878a237f3 | ||
|
|
20a1b7f2c3 | ||
|
|
4b3f15b63e | ||
|
|
81a7348286 | ||
|
|
d82e8f7199 | ||
|
|
4daffc77ce | ||
|
|
de80b6bdb5 | ||
|
|
8d2a1a417d | ||
|
|
014a93f680 | ||
|
|
80539f751c | ||
|
|
a3375bb0ba | ||
|
|
0d4c353fc3 | ||
|
|
a68b9e0e40 | ||
|
|
dbbdf7cfa4 | ||
|
|
edbe7f92d7 | ||
|
|
fc565f43f0 | ||
|
|
fe2e1217d9 | ||
|
|
d9e71b3ffa | ||
|
|
cefc04b47d | ||
|
|
775ba6ad36 | ||
|
|
84466cd0b6 | ||
|
|
9705ba8b5d | ||
|
|
a6fdf65446 | ||
|
|
08ada9641d | ||
|
|
c30957ca67 | ||
|
|
e4fad30e2a | ||
|
|
41fcf67bc5 | ||
|
|
28b49f1dfa | ||
|
|
09afa1f853 | ||
|
|
d0bebe1c3e | ||
|
|
e303ea7cf0 | ||
|
|
06dc9adf4a | ||
|
|
19f8a4a944 | ||
|
|
f6de66028e | ||
|
|
cc69cdfc34 | ||
|
|
d48f020477 | ||
|
|
0ed89b5621 | ||
|
|
0d8260c621 | ||
|
|
4633c69229 | ||
|
|
6bf7ea3ea8 | ||
|
|
07b4cebd06 | ||
|
|
4b291dacd0 | ||
|
|
174cfcd7eb | ||
|
|
bb7dceb456 | ||
|
|
fbc909b7f4 | ||
|
|
fa8b21b53f | ||
|
|
7abec5849b | ||
|
|
565cd0bdc1 | ||
|
|
89e7f54531 | ||
|
|
8462820994 | ||
|
|
c95390d499 | ||
|
|
91b846db30 | ||
|
|
4b67d15535 | ||
|
|
43225855c2 | ||
|
|
3ecfa09d8e | ||
|
|
5227409d06 | ||
|
|
3fc5efe33a | ||
|
|
a81d06005a | ||
|
|
82a35c1847 | ||
|
|
1b35dd595d | ||
|
|
28595f72ef | ||
|
|
4e138979b8 | ||
|
|
3813e58108 | ||
|
|
3c988d76af | ||
|
|
8e3ca34988 | ||
|
|
1bef78c6df | ||
|
|
4890b9a935 | ||
|
|
d842513f5c | ||
|
|
e473a6cf3f | ||
|
|
a2cb1b4108 | ||
|
|
ca88005b31 | ||
|
|
ebb7398c09 | ||
|
|
320b8fa61f | ||
|
|
8c3353e93e | ||
|
|
97ad29c439 | ||
|
|
7007e2eb63 | ||
|
|
527948ec91 | ||
|
|
cf0f710f53 | ||
|
|
4eb52ddff0 | ||
|
|
12cbff0ba5 | ||
|
|
cdb003d9bd | ||
|
|
8adead76ed | ||
|
|
d548cc3d52 | ||
|
|
9208f1f199 | ||
|
|
bfb55c7b74 | ||
|
|
a1b840bb71 | ||
|
|
5c3b5ba960 | ||
|
|
0ede5ab353 | ||
|
|
fe8e0b3fa7 | ||
|
|
11d53cb13e | ||
|
|
c57f4985d7 | ||
|
|
ae40819471 | ||
|
|
89f94a9c63 | ||
|
|
1afc41e0e4 | ||
|
|
7cfdd2f3e1 | ||
|
|
4374910057 | ||
|
|
cfb582da65 | ||
|
|
13465a27c6 | ||
|
|
ff6cbbfdf4 | ||
|
|
61db96961f | ||
|
|
8c8d615665 | ||
|
|
3d58af930a | ||
|
|
8576b3eabd | ||
|
|
71ad48a487 | ||
|
|
68ce75df26 | ||
|
|
730f25c4ce | ||
|
|
b53a18ed23 | ||
|
|
da3a164992 | ||
|
|
c97198c1ba | ||
|
|
986da4a8c2 | ||
|
|
48dba8734e | ||
|
|
28eca3acc8 | ||
|
|
1198390ece | ||
|
|
b8423c02bc | ||
|
|
6f90fee8c8 | ||
|
|
9271425c1a | ||
|
|
ab9dc62370 | ||
|
|
5f754e3e64 | ||
|
|
ed76dd9110 | ||
|
|
8b420832df | ||
|
|
43dba29089 | ||
|
|
8565d86b21 | ||
|
|
645141a5b9 | ||
|
|
1e71befed4 | ||
|
|
d0f0d5b4b5 | ||
|
|
e0d3d1530f | ||
|
|
2d53dcac33 | ||
|
|
b19a5fe29e | ||
|
|
2dded4b39d | ||
|
|
ed0caeeaef | ||
|
|
b6ceef5138 | ||
|
|
0136f832d0 | ||
|
|
b3dc47f687 | ||
|
|
f267b78873 | ||
|
|
9d55f2eb9c | ||
|
|
c08ac45efd | ||
|
|
81ad74a274 | ||
|
|
689b8e4fec | ||
|
|
7bba1d0bba | ||
|
|
051a33e2e9 | ||
|
|
7c42663436 | ||
|
|
12afb3db85 | ||
|
|
2bb305171e | ||
|
|
a65e7d034b | ||
|
|
55b32da086 | ||
|
|
6b5774c7ae | ||
|
|
3e6631e1d3 | ||
|
|
e0d464370c | ||
|
|
321156e59b | ||
|
|
a69344c067 | ||
|
|
5d011e30ff | ||
|
|
9478c6272b | ||
|
|
5a32e48eef | ||
|
|
8eeb3fdc0e | ||
|
|
bbf1e22063 | ||
|
|
79654e8e5e | ||
|
|
040a1f0de3 | ||
|
|
28b710c5ec | ||
|
|
c1ae46e4ff | ||
|
|
4a3a02c60a | ||
|
|
94055072d4 | ||
|
|
20b8f6ea83 | ||
|
|
ff968a751e | ||
|
|
13eac29c0c | ||
|
|
d690e38d50 | ||
|
|
b0d7e1b483 | ||
|
|
ea575334e9 | ||
|
|
32241643c8 | ||
|
|
7ea77e7215 | ||
|
|
ea6d952978 | ||
|
|
88c753e5ae | ||
|
|
487bb362b8 | ||
|
|
8234cc5f2b | ||
|
|
c5004ead31 | ||
|
|
3e140ea690 | ||
|
|
c0df586743 | ||
|
|
cade409208 | ||
|
|
1c3ee97f9f | ||
|
|
b059298e87 | ||
|
|
89f9d48ebb | ||
|
|
0fc1ef3488 | ||
|
|
89be60502a | ||
|
|
750a1c8e29 | ||
|
|
416513b5e7 | ||
|
|
c122412932 | ||
|
|
e32323fb86 | ||
|
|
bed8ab6427 | ||
|
|
900a661cab | ||
|
|
5404a8fd7d | ||
|
|
c8e4803913 | ||
|
|
7ccbe4e9ec | ||
|
|
4c015dee77 | ||
|
|
53a76cd768 | ||
|
|
aafcac8b09 | ||
|
|
dded463f9a | ||
|
|
a1d5b99747 | ||
|
|
79c25a3e9e | ||
|
|
85cc4b01da | ||
|
|
3bdeaf0793 | ||
|
|
a08c7af492 | ||
|
|
1919b37f3a | ||
|
|
6fb9e0489d | ||
|
|
a2597d466c | ||
|
|
fefb606912 | ||
|
|
0fe152da6f | ||
|
|
ae5817534f | ||
|
|
cdcc3d81a6 | ||
|
|
ba528b24b8 | ||
|
|
e0f26c949a | ||
|
|
66501ac5fd | ||
|
|
43f80e202f | ||
|
|
f50f9fbaa9 | ||
|
|
df6247b13e | ||
|
|
1757d5f111 | ||
|
|
0088c2cdd1 | ||
|
|
204e6cf6b8 | ||
|
|
626f3c891a | ||
|
|
dc290de4d0 | ||
|
|
ef744e6573 | ||
|
|
2dddf9e124 | ||
|
|
e8df23bdb6 | ||
|
|
e260190f2c | ||
|
|
8a7255ef27 | ||
|
|
9d2e384cb4 | ||
|
|
6f6f3112eb | ||
|
|
650d3d7e69 | ||
|
|
0cf22ffebf | ||
|
|
4e4c1abe8a | ||
|
|
86e0b019f9 | ||
|
|
fbf4ff7c59 | ||
|
|
a8cc32a4c4 | ||
|
|
0075054187 | ||
|
|
b8cb92af07 | ||
|
|
2357b81c5f | ||
|
|
9dbcc5d00c | ||
|
|
db6882b410 | ||
|
|
62a627097c | ||
|
|
0a43d44c6f | ||
|
|
7b7af3cd2d | ||
|
|
1220ed9fbe | ||
|
|
706851e2da | ||
|
|
d6de60f07d | ||
|
|
a153675c28 | ||
|
|
1382fe9d57 | ||
|
|
6828280782 | ||
|
|
d82b41319e | ||
|
|
6e1e4c5cfc | ||
|
|
7fe9b28ab2 | ||
|
|
eb51b544a2 | ||
|
|
6485278d95 | ||
|
|
c6bd820c85 | ||
|
|
4625771305 | ||
|
|
5216fcada7 | ||
|
|
32c71bbb21 | ||
|
|
e0ebe06f44 | ||
|
|
affe49eaed | ||
|
|
21128d29d3 | ||
|
|
ee7e7f067c | ||
|
|
376f8278d5 | ||
|
|
4390e4fa54 | ||
|
|
c24e6eab01 | ||
|
|
ae10f17f7d | ||
|
|
a844564629 | ||
|
|
2e369f9379 | ||
|
|
714fabe42a | ||
|
|
9dd30614f1 | ||
|
|
56c4c44b7f | ||
|
|
54948b6bf6 | ||
|
|
d894d02e02 | ||
|
|
21438b4ab2 | ||
|
|
9a98079c5c | ||
|
|
4ef6ab85d3 | ||
|
|
310df10d3c | ||
|
|
238cc65ad7 | ||
|
|
fec2e22f49 | ||
|
|
3950fcd2a4 | ||
|
|
bd2012b51d | ||
|
|
46cd14efb3 | ||
|
|
a4a687313d | ||
|
|
4154861794 | ||
|
|
f218807563 | ||
|
|
3ca1a2b641 | ||
|
|
7688454be0 | ||
|
|
58b31aee1f | ||
|
|
e089f71f3e | ||
|
|
94f460ba44 | ||
|
|
39b6a65c07 | ||
|
|
fcc1ad6361 | ||
|
|
88e4768465 | ||
|
|
b2bbee1116 | ||
|
|
4ebf025585 | ||
|
|
b89fc0826b | ||
|
|
925b78ae16 | ||
|
|
af7c03c959 | ||
|
|
5d4f279362 | ||
|
|
10ea4f30b3 | ||
|
|
bf88419982 | ||
|
|
c9aaa648ec | ||
|
|
8e0e1637b9 | ||
|
|
af2e7e34f3 | ||
|
|
8e9849ecfa | ||
|
|
531cc1bbaf | ||
|
|
2905dc1ee6 | ||
|
|
e599f28113 | ||
|
|
fc1f52d5d2 | ||
|
|
2081ab1e65 | ||
|
|
26ee9f1ff8 | ||
|
|
95312904f6 | ||
|
|
8f676acd33 | ||
|
|
576fb1fde6 | ||
|
|
f70bd6b688 | ||
|
|
e68d4180b3 | ||
|
|
ea00652f69 | ||
|
|
d09656993b | ||
|
|
01361dafa1 | ||
|
|
5cf496ddb0 | ||
|
|
8683e2b40f | ||
|
|
d93a070b03 | ||
|
|
d05688a78b | ||
|
|
36062ad1f5 | ||
|
|
619fe1103e | ||
|
|
36338b9f0b | ||
|
|
c83e66c5dc | ||
|
|
967ef44d04 | ||
|
|
647024bef8 | ||
|
|
06ee31ced0 | ||
|
|
4972776bec | ||
|
|
7ff923ba80 | ||
|
|
25f7d24643 | ||
|
|
1e5e2669a0 | ||
|
|
15fb49ad11 | ||
|
|
29c223969d | ||
|
|
d2a53ecede | ||
|
|
c26a4be6ba | ||
|
|
703de5d042 | ||
|
|
9823a0e416 | ||
|
|
2a1cb96aba | ||
|
|
208b1177b4 | ||
|
|
0554fdbccf | ||
|
|
348bceb5ce | ||
|
|
257163f220 | ||
|
|
18efd373af | ||
|
|
b17944956c | ||
|
|
e3c73d2d89 | ||
|
|
250df011f0 | ||
|
|
a40c8f4c08 | ||
|
|
fef5525203 | ||
|
|
2e0760706e | ||
|
|
2988251cc9 | ||
|
|
043a619df4 | ||
|
|
4e38d61b5b | ||
|
|
1c0ff6aa23 |
No files matched your search
+109
-2
@@ -4,5 +4,112 @@
|
||||
*.rej
|
||||
*.orig
|
||||
|
||||
clones
|
||||
tarballs
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
env/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
.hypothesis/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# celery beat schedule file
|
||||
celerybeat-schedule
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# dotenv
|
||||
.env
|
||||
|
||||
# virtualenv
|
||||
.venv
|
||||
venv/
|
||||
ENV/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode/
|
||||
|
||||
# Pytest
|
||||
.pytest_cache
|
||||
|
||||
# JetBrains IDEs (PyCharm, etc)
|
||||
.idea
|
||||
@@ -0,0 +1,69 @@
|
||||
---
|
||||
|
||||
# global settings
|
||||
image: alpine:3.8
|
||||
after_script:
|
||||
- .gitlab-ci/move_logs.sh $CI_PROJECT_DIR
|
||||
stages:
|
||||
- first
|
||||
- second
|
||||
|
||||
# device documentation
|
||||
wiki:
|
||||
stage: first
|
||||
before_script:
|
||||
- apk -q add python3
|
||||
script:
|
||||
- .gitlab-ci/check_devices_in_wiki.py --booting
|
||||
|
||||
# static code analysis (shellcheck is not in Alpine, so we use Debian)
|
||||
py-sh-static:
|
||||
stage: first
|
||||
image: python:3.6-slim-stretch
|
||||
before_script:
|
||||
- apt -q update >/dev/null
|
||||
- apt -y install flake8 shellcheck >/dev/null
|
||||
script:
|
||||
- .gitlab-ci/static_code_analysis.sh
|
||||
|
||||
# aports checks (generic)
|
||||
aports-static:
|
||||
stage: first
|
||||
before_script:
|
||||
- .gitlab-ci/install_pmbootstrap.sh pytest
|
||||
script:
|
||||
- su pmos -c ".gitlab-ci/run_testcases.sh
|
||||
-m 'not pmaports_upstream_compat'"
|
||||
artifacts:
|
||||
when: on_failure
|
||||
paths:
|
||||
- log.txt
|
||||
- log_testsuite_pmaports.txt
|
||||
- pmbootstrap.cfg
|
||||
expire_in: 1 week
|
||||
|
||||
# aports checks (upstream compatibility)
|
||||
aports-static-upstream:
|
||||
stage: second
|
||||
before_script:
|
||||
- .gitlab-ci/install_pmbootstrap.sh pytest
|
||||
script:
|
||||
- su pmos -c ".gitlab-ci/run_testcases.sh
|
||||
-m 'pmaports_upstream_compat'"
|
||||
artifacts:
|
||||
when: on_failure
|
||||
paths:
|
||||
- log.txt
|
||||
- log_testsuite_pmaports.txt
|
||||
- pmbootstrap.cfg
|
||||
expire_in: 1 week
|
||||
only:
|
||||
- master
|
||||
|
||||
# build changed aports
|
||||
aports-build:
|
||||
stage: second
|
||||
before_script:
|
||||
- .gitlab-ci/install_pmbootstrap.sh git
|
||||
script:
|
||||
- su pmos -c ".gitlab-ci/build_changed_aports.py"
|
||||
Executable
+91
@@ -0,0 +1,91 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2018 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def get_pmaports_dir():
|
||||
return os.path.realpath(os.path.join(os.path.dirname(__file__) + "/.."))
|
||||
|
||||
|
||||
def run_git(parameters):
|
||||
""" Run git in the pmaports folder and return the output """
|
||||
cmd = ["git", "-C", get_pmaports_dir()] + parameters
|
||||
return subprocess.check_output(cmd).decode()
|
||||
|
||||
|
||||
def run_pmbootstrap(parameters):
|
||||
""" Run pmbootstrap with the pmaports folder as --aports """
|
||||
cmd = ["pmbootstrap", "--aports", get_pmaports_dir()] + parameters
|
||||
process = subprocess.Popen(cmd)
|
||||
process.communicate()
|
||||
if process.returncode != 0:
|
||||
print("** Building failed")
|
||||
exit(1)
|
||||
|
||||
|
||||
def get_changed_files():
|
||||
""" Get all changed files and print them, as well as the branch and the
|
||||
commit that was used for the diff.
|
||||
:returns: list of changed files
|
||||
"""
|
||||
# Current branch
|
||||
branch = run_git(["rev-parse", "--abbrev-ref", "HEAD"])[:-1]
|
||||
print("branch: " + branch)
|
||||
|
||||
# Commit to diff against
|
||||
commit = "HEAD~1"
|
||||
if branch != "master":
|
||||
commit = run_git(["merge-base", "master", "HEAD"])[:-1]
|
||||
print("comparing HEAD with: " + commit)
|
||||
|
||||
# Changed files
|
||||
ret = run_git(["diff", "--name-only", commit, "HEAD"]).splitlines()
|
||||
print("changed file(s):")
|
||||
for file in ret:
|
||||
print(" " + file)
|
||||
return ret
|
||||
|
||||
|
||||
def get_changed_packages():
|
||||
files = get_changed_files()
|
||||
ret = set()
|
||||
for file in files:
|
||||
# Skip files in the root folder of pmaports as well as folders
|
||||
# beginning with a dot (.gitlab-ci/)
|
||||
if "/" not in file or file.startswith("."):
|
||||
continue
|
||||
|
||||
# Add to the ret set (removes duplicated automatically)
|
||||
ret.add(file.split("/")[1])
|
||||
|
||||
if len(ret) > 10:
|
||||
print("ERROR: Too many packages have changed!")
|
||||
print("This is a sanity check, so we don't end up building packages"
|
||||
" that have not been modified. CI won't run for more than one"
|
||||
" hour anyway.")
|
||||
print("If you see this message on your personal fork of the"
|
||||
" pmbootstrap repository, try to update your fork's master"
|
||||
" branch to the upstream master branch.")
|
||||
sys.exit(1)
|
||||
return ret
|
||||
|
||||
|
||||
def check_build(packages):
|
||||
# Initialize build environment with less logging
|
||||
run_pmbootstrap(["build_init"])
|
||||
run_pmbootstrap(["--details-to-stdout", "build", "--strict"] +
|
||||
list(packages))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
packages = get_changed_packages()
|
||||
|
||||
if len(packages) == 0:
|
||||
print("no aports changed in this branch")
|
||||
else:
|
||||
print("building in strict mode: " + ", ".join(packages))
|
||||
check_build(packages)
|
||||
Executable
+112
@@ -0,0 +1,112 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2018 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import argparse
|
||||
import glob
|
||||
import os
|
||||
import sys
|
||||
import urllib.request
|
||||
|
||||
|
||||
def get_devices():
|
||||
""":returns: list of all devices"""
|
||||
ret = []
|
||||
pmaports = (os.path.realpath(os.path.join(os.path.dirname(__file__) +
|
||||
"/..")))
|
||||
for path in glob.glob(pmaports + "/device/device-*/"):
|
||||
device = os.path.dirname(path).split("device-", 1)[1]
|
||||
ret.append(device)
|
||||
return sorted(ret)
|
||||
|
||||
|
||||
def get_wiki_devices_html(path):
|
||||
""":param path: to a local file with the saved content of the devices wiki
|
||||
page or None to download a fresh copy
|
||||
:returns: HTML of the page, split into booting and not booting:
|
||||
{"booting": "<!DOCTYPE HTML>\n<html..."
|
||||
"not_booting": "Not booting</span></h2>\n<p>These..."}"""
|
||||
content = ""
|
||||
if path:
|
||||
# Read file
|
||||
with open(path, encoding="utf-8") as handle:
|
||||
content = handle.read()
|
||||
else:
|
||||
# Download wiki page
|
||||
url = "http://wiki.postmarketos.org/wiki/Devices"
|
||||
content = urllib.request.urlopen(url).read().decode("utf-8")
|
||||
|
||||
# Split into booting and not booting
|
||||
split = content.split("<span class=\"mw-headline\" id=\"Not_booting\">")
|
||||
|
||||
if len(split) != 2:
|
||||
print("*** Failed to parse wiki page")
|
||||
sys.exit(2)
|
||||
return {"booting": split[0], "not_booting": split[1]}
|
||||
|
||||
|
||||
def check_device(device, html, is_booting):
|
||||
""":param is_booting: require the device to be in the booting section, not
|
||||
just anywhere in the page (i.e. in the not booting
|
||||
table).
|
||||
:returns: True when the device is in the appropriate section."""
|
||||
if device in html["booting"]:
|
||||
return True
|
||||
if device in html["not_booting"]:
|
||||
if is_booting:
|
||||
print(device + ": still in 'not booting' section (if this is a"
|
||||
" merge request, your device should be in the booting"
|
||||
" section already)")
|
||||
return False
|
||||
return True
|
||||
|
||||
print(device + ": not in the wiki yet.")
|
||||
return False
|
||||
|
||||
|
||||
def main():
|
||||
# Parse arguments
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--booting", help="devices must be in the upper table,"
|
||||
" being in the 'not booting' table below is not"
|
||||
" enough (all devices in pmaports master and stable"
|
||||
" branches and should be in the upper table)",
|
||||
action="store_true")
|
||||
parser.add_argument("--path", help="instead of downloading the devices"
|
||||
" page from the wiki, use a local HTML file",
|
||||
default=None)
|
||||
args = parser.parse_args()
|
||||
|
||||
# Check all devices
|
||||
html = get_wiki_devices_html(args.path)
|
||||
error = False
|
||||
for device in get_devices():
|
||||
if not check_device(device, html, args.booting):
|
||||
error = True
|
||||
|
||||
# Ask to adjust the wiki
|
||||
if error:
|
||||
print("*** Wiki check failed!")
|
||||
print("Thank you for porting postmarketOS to a new device! \o/")
|
||||
print("")
|
||||
print("Now it's time to add some documentation:")
|
||||
print("1) Create a device specific wiki page as described here:")
|
||||
print(" <https://wiki.postmarketos.org/wiki/Help:Device_Page>")
|
||||
print("2) Add your device to the overview matrix:")
|
||||
print(" <https://wiki.postmarketos.org/wiki/Devices>")
|
||||
print("3) Run these tests again with an empty commit in your MR:")
|
||||
print(" $ git commit --allow-empty -m 'run tests again'")
|
||||
print("")
|
||||
print("Please take the time to do these steps. It will make your")
|
||||
print("precious porting efforts visible for others, and allow them")
|
||||
print("not only to use what you have created, but also to build upon")
|
||||
print("it more easily. Many times one person did a port with basic")
|
||||
print("functionallity, and then someone else jumped in and")
|
||||
print("contributed major new features.")
|
||||
return 1
|
||||
else:
|
||||
print("*** Wiki check successful!")
|
||||
return 0
|
||||
|
||||
|
||||
sys.exit(main())
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh -e
|
||||
# Copyright 2018 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# usage: install_pmbootstrap.sh [ADDITIONAL_PACKAGE, ...]
|
||||
|
||||
# Config: pmbootstrap tag (or branch)
|
||||
tag="master"
|
||||
|
||||
# Get download URL and pmaports path
|
||||
url="https://gitlab.com/postmarketOS/pmbootstrap/-/archive/$tag/pmbootstrap-$tag.tar.bz2"
|
||||
pmaports="$(cd $(dirname $0)/..; pwd -P)"
|
||||
|
||||
# Set up depends and binfmt_misc
|
||||
depends="coreutils openssl python3 sudo $@"
|
||||
echo "Installing dependencies: $depends"
|
||||
apk -q add $depends
|
||||
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
|
||||
|
||||
# Create pmos user
|
||||
echo "Creating pmos user"
|
||||
adduser -D pmos
|
||||
chown -R pmos:pmos .
|
||||
echo 'pmos ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
|
||||
# Download pmbootstrap (to /tmp/pmbootstrap)
|
||||
echo "Downloading pmbootstrap ($tag): $url"
|
||||
cd /tmp
|
||||
wget -q -O "pmb.tar.bz2" "$url"
|
||||
tar -xf "pmb.tar.bz2"
|
||||
mv pmbootstrap-* pmbootstrap
|
||||
|
||||
# Install to $PATH and init
|
||||
ln -s /tmp/pmbootstrap/pmbootstrap.py /usr/local/bin/pmbootstrap
|
||||
echo "Initializing pmbootstrap"
|
||||
su pmos -c "yes '' | pmbootstrap -q --aports '$pmaports' init"
|
||||
echo ""
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh -e
|
||||
# Copyright 2018 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: $(basename $0) \$CI_PROJECT_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for log in \
|
||||
/home/pmos/.local/var/pmbootstrap/log.txt \
|
||||
/home/pmos/.local/var/pmbootstrap/log_testsuite_pmaports.txt \
|
||||
/home/pmos/.config/pmbootstrap.cfg \
|
||||
; do
|
||||
[ -e "$log" ] && mv "$log" "$1"
|
||||
done
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh -e
|
||||
# Copyright 2018 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Require pmbootstrap
|
||||
if ! command -v pmbootstrap > /dev/null; then
|
||||
echo "ERROR: pmbootstrap needs to be installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Wrap pmbootstrap to use this repository for --aports
|
||||
pmaports="$(cd $(dirname $0)/..; pwd -P)"
|
||||
_pmbootstrap="$(command -v pmbootstrap)"
|
||||
pmbootstrap() {
|
||||
"$_pmbootstrap" --aports="$pmaports" "$@"
|
||||
}
|
||||
|
||||
# Make sure that the work folder format is up to date, and that there are no
|
||||
# mounts from aborted test cases (pmbootstrap#1595)
|
||||
pmbootstrap work_migrate
|
||||
pmbootstrap -q shutdown
|
||||
|
||||
# Make sure we have a valid device (pmbootstrap#1128)
|
||||
device="$(pmbootstrap config device)"
|
||||
deviceinfo="$pmaports/device/device-$device/deviceinfo"
|
||||
if ! [ -e "$deviceinfo" ]; then
|
||||
echo "ERROR: Could not find deviceinfo file for selected device '$device'."
|
||||
echo "Expected path: $deviceinfo"
|
||||
echo "Maybe you have switched to a branch where your device does not exist?"
|
||||
echo "Use 'pmbootstrap config device qemu-amd64' to switch to a valid device."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run testcases
|
||||
pytest -vv -x --tb=native "$pmaports/.gitlab-ci/testcases" "$@"
|
||||
Executable
+58
@@ -0,0 +1,58 @@
|
||||
#!/bin/sh -e
|
||||
# Copyright 2018 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
set -e
|
||||
DIR="$(cd "$(dirname "$0")" && pwd -P)"
|
||||
cd "$DIR/.."
|
||||
|
||||
# Find CHANGEMEs in APKBUILDs
|
||||
if grep -qr '(CHANGEME!)' device; then
|
||||
echo "ERROR: Please replace '(CHANGEME!)' in the following files:"
|
||||
grep --color=always -r '(CHANGEME!)' device
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Shell: shellcheck
|
||||
sh_files="
|
||||
./main/postmarketos-base/firmwareload.sh
|
||||
./main/postmarketos-mkinitfs/init.sh.in
|
||||
./main/postmarketos-mkinitfs/init_functions.sh
|
||||
./main/postmarketos-mkinitfs-hook-debug-shell/20-debug-shell.sh
|
||||
./main/postmarketos-update-kernel/update-kernel.sh
|
||||
./main/postmarketos-android-recovery-installer/build_zip.sh
|
||||
./main/postmarketos-android-recovery-installer/pmos_chroot
|
||||
./main/postmarketos-android-recovery-installer/pmos_install
|
||||
./main/postmarketos-android-recovery-installer/pmos_install_functions
|
||||
./main/postmarketos-android-recovery-installer/pmos_setpw
|
||||
./main/postmarketos-android-recovery-installer/update-binary
|
||||
./main/mdss-fb-init-hack/mdss-fb-init-hack.sh
|
||||
./main/postmarketos-ui-hildon/postmarketos-ui-hildon.post-install
|
||||
$(find . -path './main/postmarketos-ui-hildon/*.sh')
|
||||
$(find . -name '*.trigger')
|
||||
$(find . -path './main/devicepkg-dev/*.sh')
|
||||
|
||||
$(find . -path '.gitlab-ci/*.sh')
|
||||
"
|
||||
for file in ${sh_files}; do
|
||||
echo "Test with shellcheck: $file"
|
||||
cd "$DIR/../$(dirname "$file")"
|
||||
shellcheck -e SC1008 -x "$(basename "$file")"
|
||||
done
|
||||
|
||||
# Python: flake8
|
||||
# E501: max line length
|
||||
# F401: imported, but not used (false positive: add_pmbootstrap_to_import_path)
|
||||
# E722: do not use bare except
|
||||
cd "$DIR/.."
|
||||
|
||||
echo "Test with flake8: testcases"
|
||||
# shellcheck disable=SC2086
|
||||
flake8 --ignore E501,F401,E722,W504,W605 $(find . -path "./.gitlab-ci/testcases/*.py")
|
||||
|
||||
echo "Test with flake8: all other Python files"
|
||||
# shellcheck disable=SC2086
|
||||
flake8 --ignore E501,E722,W504,W605 $(find . -not -path './.gitlab-ci/testcases/*' -a -name '*.py')
|
||||
|
||||
# Done
|
||||
echo "Success!"
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2018 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import shutil
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
def path_pmbootstrap():
|
||||
""" Find the pmbootstrap installation folder, so we can import the Python
|
||||
code from there.
|
||||
returns: pmbootstrap installation folder
|
||||
"""
|
||||
# Find 'pmbootstrap' executable
|
||||
bin = shutil.which("pmbootstrap")
|
||||
if not bin:
|
||||
print("ERROR: 'pmbootstrap' not found in $PATH")
|
||||
sys.exit(1)
|
||||
|
||||
# Resolve the symlink and verify the folder
|
||||
dir = os.path.dirname(os.path.realpath(bin))
|
||||
if os.path.exists(dir + "/pmb/__init__.py"):
|
||||
return dir
|
||||
|
||||
# Symlink not set up properly
|
||||
print("ERROR: 'pmbootstrap' is not a symlink to pmbootstrap.py")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
# Add pmbootstrap dir to import path
|
||||
sys.path.append(os.path.realpath(path_pmbootstrap()))
|
||||
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2018 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import filecmp
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.aportgen
|
||||
import pmb.config
|
||||
import pmb.helpers.logging
|
||||
import pmb.parse
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def args(request):
|
||||
# Initialize args
|
||||
sys.argv = ["pmbootstrap",
|
||||
"--aports", os.path.dirname(__file__) + "/../..",
|
||||
"--log", "$WORK/log_testsuite_pmaports.txt"
|
||||
"chroot"]
|
||||
args = pmb.parse.arguments()
|
||||
|
||||
# Initialize logging
|
||||
pmb.helpers.logging.init(args)
|
||||
request.addfinalizer(args.logfd.close)
|
||||
return args
|
||||
|
||||
|
||||
def test_aportgen(args, tmpdir):
|
||||
# Fake aports folder in tmpdir
|
||||
aports_real = args.aports
|
||||
args.aports = str(tmpdir)
|
||||
pmb.helpers.run.user(args, ["mkdir", "-p", str(tmpdir) + "/cross"])
|
||||
|
||||
# Create aportgen folder -> code path where it still exists
|
||||
pmb.helpers.run.user(args, ["mkdir", "-p", args.work + "/aportgen"])
|
||||
|
||||
# Generate all valid packages (gcc twice -> different code path)
|
||||
pkgnames = ["binutils-armhf", "musl-armhf", "busybox-static-armhf",
|
||||
"gcc-armhf", "gcc-armhf"]
|
||||
for pkgname in pkgnames:
|
||||
pmb.aportgen.generate(args, pkgname)
|
||||
path_new = args.aports + "/cross/" + pkgname + "/APKBUILD"
|
||||
path_old = aports_real + "/cross/" + pkgname + "/APKBUILD"
|
||||
assert os.path.exists(path_new)
|
||||
assert filecmp.cmp(path_new, path_old, False)
|
||||
|
||||
|
||||
def test_aportgen_invalid_generator(args):
|
||||
with pytest.raises(ValueError) as e:
|
||||
pmb.aportgen.generate(args, "pkgname-with-no-generator")
|
||||
assert "No generator available" in str(e.value)
|
||||
|
||||
|
||||
def test_aportgen_get_upstream_aport(args, monkeypatch):
|
||||
|
||||
# Fake pmb.parse.apkbuild()
|
||||
def fake_apkbuild(*args, **kwargs):
|
||||
return apkbuild
|
||||
monkeypatch.setattr(pmb.parse, "apkbuild", fake_apkbuild)
|
||||
|
||||
# Fake pmb.parse.apkindex.package()
|
||||
def fake_package(*args, **kwargs):
|
||||
return package
|
||||
monkeypatch.setattr(pmb.parse.apkindex, "package", fake_package)
|
||||
|
||||
# Equal version
|
||||
func = pmb.aportgen.core.get_upstream_aport
|
||||
upstream = "main/gcc"
|
||||
upstream_full = args.work + "/cache_git/aports_upstream/" + upstream
|
||||
apkbuild = {"pkgver": "2.0", "pkgrel": "0"}
|
||||
package = {"version": "2.0-r0"}
|
||||
assert func(args, upstream) == upstream_full
|
||||
|
||||
# APKBUILD < binary
|
||||
apkbuild = {"pkgver": "1.0", "pkgrel": "0"}
|
||||
package = {"version": "2.0-r0"}
|
||||
with pytest.raises(RuntimeError) as e:
|
||||
func(args, upstream)
|
||||
assert str(e.value).startswith("You can update your local checkout with")
|
||||
|
||||
# APKBUILD > binary
|
||||
apkbuild = {"pkgver": "3.0", "pkgrel": "0"}
|
||||
package = {"version": "2.0-r0"}
|
||||
with pytest.raises(RuntimeError) as e:
|
||||
func(args, upstream)
|
||||
assert str(e.value).startswith("You can force an update of your binary")
|
||||
@@ -0,0 +1,138 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2018 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import glob
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.parse
|
||||
import pmb.parse._apkbuild
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def args(request):
|
||||
# Initialize args
|
||||
sys.argv = ["pmbootstrap",
|
||||
"--aports", os.path.dirname(__file__) + "/../..",
|
||||
"--log", "$WORK/log_testsuite_pmaports.txt"
|
||||
"chroot"]
|
||||
args = pmb.parse.arguments()
|
||||
|
||||
# Initialize logging
|
||||
pmb.helpers.logging.init(args)
|
||||
request.addfinalizer(args.logfd.close)
|
||||
return args
|
||||
|
||||
|
||||
def test_deviceinfo(args):
|
||||
"""
|
||||
Parse all deviceinfo files successfully and run checks on the parsed data.
|
||||
"""
|
||||
# Iterate over all devices
|
||||
last_exception = None
|
||||
count = 0
|
||||
for folder in glob.glob(args.aports + "/device/device-*"):
|
||||
device = folder[len(args.aports):].split("-", 1)[1]
|
||||
|
||||
try:
|
||||
# Check for successful deviceinfo parsing
|
||||
info = pmb.parse.deviceinfo(args, device)
|
||||
|
||||
# deviceinfo_name must start with manufacturer
|
||||
name = info["name"]
|
||||
manufacturer = info["manufacturer"]
|
||||
if not name.startswith(manufacturer) and \
|
||||
not name.startswith("Google"):
|
||||
raise RuntimeError("Please add the manufacturer in front of"
|
||||
" the deviceinfo_name, e.g.: '" +
|
||||
manufacturer + " " + name + "'")
|
||||
|
||||
# Don't abort on first error
|
||||
except Exception as e:
|
||||
last_exception = e
|
||||
count += 1
|
||||
print(device + ": " + str(e))
|
||||
|
||||
# Raise the last exception
|
||||
if last_exception:
|
||||
print("deviceinfo error count: " + str(count))
|
||||
raise last_exception
|
||||
|
||||
|
||||
def test_aports_device(args):
|
||||
"""
|
||||
Various tests performed on the /device/device-* aports.
|
||||
"""
|
||||
for path in glob.glob(args.aports + "/device/device-*/APKBUILD"):
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
|
||||
# Depends: Require "postmarketos-base"
|
||||
if "postmarketos-base" not in apkbuild["depends"]:
|
||||
raise RuntimeError("Missing 'postmarketos-base' in depends of " +
|
||||
path)
|
||||
|
||||
# Depends: Must not have firmware packages
|
||||
for depend in apkbuild["depends"]:
|
||||
if (depend.startswith("firmware-") or
|
||||
depend.startswith("linux-firmware")):
|
||||
raise RuntimeError("Firmware package '" + depend + "' found in"
|
||||
" depends of " + path + ". These go into"
|
||||
" subpackages now, see"
|
||||
" <https://postmarketos.org/devicepkg>.")
|
||||
|
||||
|
||||
def test_aports_device_kernel(args):
|
||||
"""
|
||||
Verify the kernels specified in the device packages:
|
||||
* Kernel must not be in depends when kernels are in subpackages
|
||||
* Check if only one kernel is defined in depends
|
||||
* Validate kernel subpackage names
|
||||
"""
|
||||
# Generate list of valid subpackages
|
||||
valid_subpackages = ["downstream", "rpi", "rpi2"]
|
||||
for path in glob.glob(args.aports + "/main/linux-postmarketos-*"):
|
||||
suffix = os.path.basename(path)[len("linux-postmarketos-"):]
|
||||
valid_subpackages.append(suffix)
|
||||
|
||||
# Iterate over device aports
|
||||
for path in glob.glob(args.aports + "/device/device-*/APKBUILD"):
|
||||
# Parse apkbuild and kernels from subpackages
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
device = apkbuild["pkgname"][len("device-"):]
|
||||
kernels_subpackages = pmb.parse._apkbuild.kernels(args, device)
|
||||
|
||||
# Parse kernels from depends
|
||||
kernels_depends = []
|
||||
for depend in apkbuild["depends"]:
|
||||
if not depend.startswith("linux-"):
|
||||
continue
|
||||
kernels_depends.append(depend)
|
||||
|
||||
# Kernel in subpackages *and* depends
|
||||
if kernels_subpackages:
|
||||
raise RuntimeError("Kernel package '" + depend + "' needs to"
|
||||
" be removed when using kernel" +
|
||||
" subpackages: " + path)
|
||||
|
||||
# No kernel
|
||||
if not kernels_depends and not kernels_subpackages:
|
||||
raise RuntimeError("Device doesn't have a kernel in depends or"
|
||||
" subpackages: " + path)
|
||||
|
||||
# Multiple kernels in depends
|
||||
if len(kernels_depends) > 1:
|
||||
raise RuntimeError("Please use kernel subpackages instead of"
|
||||
" multiple kernels in depends (see"
|
||||
" <https://postmarketos.org/devicepkg>): " +
|
||||
path)
|
||||
|
||||
# Verify subpackages
|
||||
if kernels_subpackages:
|
||||
for subpackage in kernels_subpackages:
|
||||
if subpackage not in valid_subpackages:
|
||||
raise RuntimeError("Invalid kernel subpackage name '" +
|
||||
subpackage + "', valid: " +
|
||||
str(valid_subpackages))
|
||||
@@ -0,0 +1,110 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2018 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import glob
|
||||
import logging
|
||||
import os
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.config
|
||||
import pmb.parse
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def args(request):
|
||||
# Initialize args
|
||||
sys.argv = ["pmbootstrap",
|
||||
"--aports", os.path.dirname(__file__) + "/../..",
|
||||
"--log", "$WORK/log_testsuite_pmaports.txt"
|
||||
"chroot"]
|
||||
args = pmb.parse.arguments()
|
||||
|
||||
# Initialize logging
|
||||
pmb.helpers.logging.init(args)
|
||||
request.addfinalizer(args.logfd.close)
|
||||
return args
|
||||
|
||||
|
||||
def get_categorized_kde_packages(args):
|
||||
"""
|
||||
Parse all aports in the kde folder, and categorize them.
|
||||
|
||||
:returns: {"plasma": {"kwin": "5.13.3", ...},
|
||||
"kde": {"kcrash": "5.48.0", ...},
|
||||
"other": {"konsole": "1234", ...}}
|
||||
"""
|
||||
ret = {"plasma": {}, "kde": {}, "other": {}}
|
||||
|
||||
for path in glob.glob(args.aports + "/kde/*/APKBUILD"):
|
||||
# Parse APKBUILD
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
url = apkbuild["url"]
|
||||
pkgname = apkbuild["pkgname"]
|
||||
pkgver = apkbuild["pkgver"]
|
||||
|
||||
# Categorize by URL
|
||||
category = "other"
|
||||
if "https://www.kde.org/workspaces/plasmadesktop" in url:
|
||||
category = "plasma"
|
||||
elif "https://community.kde.org/Frameworks" in url:
|
||||
category = "kde"
|
||||
|
||||
# Save result
|
||||
ret[category][pkgname] = pkgver
|
||||
return ret
|
||||
|
||||
|
||||
def check_categories(categories):
|
||||
"""
|
||||
Make sure that all packages in one framework (kde, plasma) have the same
|
||||
package version (and that there is at least one package in each category).
|
||||
|
||||
:param categories: see return of get_categorized_kde_packages()
|
||||
:returns: True when the check passed, False otherwise
|
||||
"""
|
||||
ret = True
|
||||
for category, packages in categories.items():
|
||||
reference = None
|
||||
for pkgname, pkgver in packages.items():
|
||||
|
||||
# Use the first package as reference and print a summary
|
||||
if not reference:
|
||||
logging.info("---")
|
||||
logging.info("KDE package category: " + category)
|
||||
logging.info("Packages (" + str(len(packages)) + "): " +
|
||||
", ".join(sorted(packages.keys())))
|
||||
reference = {"pkgname": pkgname, "pkgver": pkgver}
|
||||
|
||||
# Category "other": done after printing the summary, no need to
|
||||
# compare the package versions
|
||||
if category == "other":
|
||||
break
|
||||
|
||||
# Print the reference and skip checking it against itself
|
||||
logging.info("Reference pkgver: " + pkgver + " (from '" +
|
||||
pkgname + "')")
|
||||
continue
|
||||
|
||||
# Check version against reference
|
||||
if pkgver != reference["pkgver"]:
|
||||
logging.info("ERROR: " + pkgname + " has version " + pkgver)
|
||||
ret = False
|
||||
|
||||
# Each category must at least have one package
|
||||
if not reference:
|
||||
logging.info("ERROR: could not find any packages in category: " +
|
||||
category)
|
||||
ret = False
|
||||
return ret
|
||||
|
||||
|
||||
def test_kde_versions(args):
|
||||
"""
|
||||
Make sure that KDE packages of the same framework have the same version.
|
||||
"""
|
||||
categories = get_categorized_kde_packages(args)
|
||||
if not check_categories(categories):
|
||||
raise RuntimeError("KDE version check failed!")
|
||||
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2018 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
"""
|
||||
This file uses pmb.helper.pkgrel_bump to check if the aports need a pkgrel bump
|
||||
for any package, caused by a soname bump. Example: A new libressl/openssl
|
||||
version was released, which increased the soname version, and now all packages
|
||||
that link against it, need to be rebuilt.
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.helpers.pkgrel_bump
|
||||
import pmb.helpers.logging
|
||||
import pmb.parse
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def args(request):
|
||||
# Initialize args
|
||||
sys.argv = ["pmbootstrap",
|
||||
"--aports", os.path.dirname(__file__) + "/../..",
|
||||
"--log", "$WORK/log_testsuite_pmaports.txt"
|
||||
"chroot"]
|
||||
args = pmb.parse.arguments()
|
||||
|
||||
# Initialize logging
|
||||
pmb.helpers.logging.init(args)
|
||||
request.addfinalizer(args.logfd.close)
|
||||
return args
|
||||
|
||||
|
||||
@pytest.mark.pmaports_upstream_compat
|
||||
def test_soname_bump(args):
|
||||
if pmb.helpers.pkgrel_bump.auto(args, True):
|
||||
raise RuntimeError("One or more packages need to be rebuilt, because"
|
||||
" a library they link against had an incompatible"
|
||||
" upgrade (soname bump). Run 'pmbootstrap"
|
||||
" pkgrel_bump --auto' to automatically increase the"
|
||||
" pkgrel in order to trigger a rebuild. If this"
|
||||
" test case failed during a pull request, the issue"
|
||||
" needs to be fixed on the 'master' branch first,"
|
||||
" then rebase your PR on 'master' afterwards.")
|
||||
@@ -0,0 +1,107 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2018 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import os
|
||||
import sys
|
||||
import glob
|
||||
import pytest
|
||||
|
||||
import add_pmbootstrap_to_import_path
|
||||
import pmb.helpers.logging
|
||||
import pmb.parse.apkindex
|
||||
import pmb.parse
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def args(request):
|
||||
# Initialize args
|
||||
sys.argv = ["pmbootstrap",
|
||||
"--aports", os.path.dirname(__file__) + "/../..",
|
||||
"--log", "$WORK/log_testsuite_pmaports.txt"
|
||||
"chroot"]
|
||||
args = pmb.parse.arguments()
|
||||
|
||||
# Initialize logging
|
||||
pmb.helpers.logging.init(args)
|
||||
request.addfinalizer(args.logfd.close)
|
||||
return args
|
||||
|
||||
|
||||
@pytest.mark.pmaports_upstream_compat
|
||||
def test_qt_versions(args):
|
||||
"""
|
||||
Verify, that all postmarketOS qt5- package versions match with Alpine's
|
||||
qt5-qtbase version.
|
||||
"""
|
||||
# Upstream version
|
||||
index = pmb.helpers.repo.alpine_apkindex_path(args, "community", "x86_64")
|
||||
index_data = pmb.parse.apkindex.package(args, "qt5-qtbase",
|
||||
indexes=[index])
|
||||
pkgver_upstream = index_data["version"].split("-r")[0]
|
||||
|
||||
# Iterate over our packages
|
||||
failed = []
|
||||
for path in glob.glob(args.aports + "/*/qt5-*/APKBUILD"):
|
||||
# Read the pkgver
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
pkgname = apkbuild["pkgname"]
|
||||
pkgver = apkbuild["pkgver"]
|
||||
|
||||
# When we temporarily override packages from Alpine, we set the pkgver
|
||||
# to 9999 and _pkgver contains the real version (see #994).
|
||||
if pkgver == "9999":
|
||||
pkgver = apkbuild["_pkgver"]
|
||||
|
||||
# Compare
|
||||
if pkgver == pkgver_upstream:
|
||||
continue
|
||||
failed.append(pkgname + ": " + pkgver + " != " +
|
||||
pkgver_upstream)
|
||||
|
||||
assert [] == failed
|
||||
|
||||
|
||||
@pytest.mark.pmaports_upstream_compat
|
||||
def test_aportgen_versions(args):
|
||||
"""
|
||||
Verify that the packages generated by 'pmbootstrap aportgen' have
|
||||
the same version (pkgver *and* pkgrel!) as the upstream packages
|
||||
they are based on.
|
||||
"""
|
||||
# Get Alpine's "main" repository APKINDEX path
|
||||
index = pmb.helpers.repo.alpine_apkindex_path(args, "main", "x86_64")
|
||||
|
||||
# Alpine packages and patterns for our derivatives
|
||||
map = {"binutils": "binutils-*",
|
||||
"busybox": "busybox-static-*",
|
||||
"gcc": "gcc-*",
|
||||
"musl": "musl-*"}
|
||||
|
||||
# Iterate over Alpine packages
|
||||
failed = []
|
||||
generated = "# Automatically generated aport, do not edit!"
|
||||
for pkgname, pattern in map.items():
|
||||
# Upstream version
|
||||
index_data = pmb.parse.apkindex.package(args, pkgname,
|
||||
indexes=[index])
|
||||
version_upstream = index_data["version"]
|
||||
|
||||
# Iterate over our packages
|
||||
for path in glob.glob(args.aports + "/*/" + pattern + "/APKBUILD"):
|
||||
# Skip non-aportgen APKBUILDs
|
||||
with open(path) as handle:
|
||||
if generated not in handle.read():
|
||||
continue
|
||||
|
||||
# Compare the version
|
||||
print("Checking " + path)
|
||||
apkbuild = pmb.parse.apkbuild(args, path)
|
||||
version = apkbuild["pkgver"] + "-r" + apkbuild["pkgrel"]
|
||||
if version != version_upstream:
|
||||
failed.append(apkbuild["pkgname"] + ": " + version +
|
||||
" != " + version_upstream +
|
||||
" (from " + pkgname + ")")
|
||||
continue
|
||||
|
||||
assert [] == failed
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
@@ -1,18 +1,7 @@
|
||||
# KDE Nightly
|
||||
# postmarketOS aports
|
||||
|
||||
This branch includes APKBUILDs to build all of KDE nightly straight from git master.
|
||||
It's not intended to be used on systems that people rely on, rather it's meant to ease development and for easy testing.
|
||||
|
||||
See https://wiki.postmarketos.org/Nightly for more details.
|
||||
|
||||
## Disabled packages
|
||||
|
||||
Sometimes packages don't build due to various external reasons.
|
||||
These are removed from the repo to allow building the rest of the repository but will have to be re-added once they're fixed.
|
||||
They can be restored with `git checkout <commit they were removed in>^ -- packages/<package name>`).
|
||||
|
||||
Here is the current list:
|
||||
- `akonadiconsole`, it's dependency `xapian-bindings` is currently disabled in Alpine
|
||||
- `oxygen`, requires currently unmerged PR's
|
||||
- `kimagemapeditor`, currently incompatible with `kio`
|
||||
- `k3b`, currently incompatible with `kbookmarks`
|
||||
Helpful resources:
|
||||
* [How to create a package](https://wiki.postmarketos.org/wiki/Create_a_package)
|
||||
* [APKBUILD reference](https://wiki.alpinelinux.org/wiki/APKBUILD_Reference)
|
||||
* [Alpine Linux aports](https://git.alpinelinux.org/cgit/aports)
|
||||
* [Alpine Linux package search](https://pkgs.alpinelinux.org/packages)
|
||||
@@ -0,0 +1,39 @@
|
||||
pkgname=android-libcutils
|
||||
pkgver=7.0.0_r34
|
||||
pkgrel=0
|
||||
pkgdesc="Android low-level utility library"
|
||||
url="https://github.com/android/platform_system_core"
|
||||
arch="all"
|
||||
license="APACHE2"
|
||||
depends=""
|
||||
makedepends="bsd-compat-headers android-liblog android-liblog-dev"
|
||||
options="!check"
|
||||
source="
|
||||
android_platform_system_core-$pkgver.tar.gz::https://github.com/android/platform_system_core/archive/android-${pkgver}.tar.gz
|
||||
Makefile"
|
||||
_lib="cutils"
|
||||
subpackages="$pkgname-dev"
|
||||
builddir="$srcdir"/platform_system_core-android-$pkgver/lib${_lib}
|
||||
|
||||
prepare() {
|
||||
cp "$srcdir"/Makefile "$builddir"
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
# Library
|
||||
install -Dm644 "${builddir}/lib${_lib}.so" \
|
||||
"${pkgdir}/usr/lib/android/lib${_lib}.so"
|
||||
|
||||
# Header files
|
||||
mkdir -p "${pkgdir}/usr/include/android/"
|
||||
cp -r "${srcdir}/platform_system_core-android-${pkgver}/include/${_lib}" \
|
||||
"${pkgdir}/usr/include/android/"
|
||||
}
|
||||
|
||||
sha512sums="f84d31db61f86c73b8aecbaf788d43b0a2cc984121fd7244a2f7ca2a2a751437b8708acdd27cb86a260162e866c40f6015f14d52beb3a85e9ae2efd6f44b73f3 android_platform_system_core-7.0.0_r34.tar.gz
|
||||
2aeab8d7267508a7c570a57f771796a9ed8cd7747d3dd33a84535c66331a7f6cf147919e8859f74de27a13d760af7de9f7e69aa688515451a21320603c4c4f4b Makefile"
|
||||
@@ -0,0 +1,62 @@
|
||||
LD := gcc
|
||||
LDFLAGS := -L/usr/lib/android/ -shared
|
||||
LIBS := -l:liblog.so
|
||||
CXX := g++
|
||||
CXXFLAGS := -std=c++14 -Wall -I../include -fPIC
|
||||
CC := gcc
|
||||
|
||||
# char16_t workaround: https://stackoverflow.com/a/22369822
|
||||
CFLAGS := -Wall -I../include -Dchar16_t=uint16_t -fPIC
|
||||
|
||||
# From Android.mk: libcutils_common_sources, libcutils_nonwindows_sources
|
||||
SRC_C := \
|
||||
atomic.c \
|
||||
config_utils.c \
|
||||
fs_config.c \
|
||||
canned_fs_config.c \
|
||||
hashmap.c \
|
||||
iosched_policy.c \
|
||||
load_file.c \
|
||||
native_handle.c \
|
||||
open_memstream.c \
|
||||
process_name.c \
|
||||
record_stream.c \
|
||||
sched_policy.c \
|
||||
strdup16to8.c \
|
||||
strdup8to16.c \
|
||||
strlcpy.c \
|
||||
threads.c \
|
||||
fs.c \
|
||||
multiuser.c \
|
||||
socket_inaddr_any_server_unix.c \
|
||||
socket_local_client_unix.c \
|
||||
socket_local_server_unix.c \
|
||||
socket_loopback_client_unix.c \
|
||||
socket_loopback_server_unix.c \
|
||||
socket_network_client_unix.c \
|
||||
str_parms.c
|
||||
|
||||
SRC_CPP := \
|
||||
sockets_unix.cpp \
|
||||
sockets.cpp
|
||||
|
||||
OBJECTS := $(SRC_C:%.c=%.c.o) $(SRC_CPP:%.cpp=%.cpp.o)
|
||||
|
||||
all: libcutils.so
|
||||
|
||||
%.c.o: %.c
|
||||
$(info CC $<)
|
||||
@$(CC) -c -o $@ $< $(CFLAGS)
|
||||
|
||||
%.cpp.o: %.cpp
|
||||
$(info CC $<)
|
||||
@$(CXX) -c -o $@ $< $(CXXFLAGS)
|
||||
|
||||
libcutils.so: $(OBJECTS)
|
||||
$(info LD $@)
|
||||
@$(LD) -o $@ $^ $(LDFLAGS) $(LIBS)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
rm -v libcutils.so *.o
|
||||
@@ -0,0 +1,39 @@
|
||||
pkgname=android-liblog
|
||||
pkgver=7.0.0_r34
|
||||
pkgrel=0
|
||||
pkgdesc="Android low-level logging library"
|
||||
url="https://github.com/android/platform_system_core"
|
||||
arch="all"
|
||||
license="APACHE2"
|
||||
depends=""
|
||||
makedepends="bsd-compat-headers"
|
||||
options="!check"
|
||||
source="
|
||||
android_platform_system_core-$pkgver.tar.gz::https://github.com/android/platform_system_core/archive/android-${pkgver}.tar.gz
|
||||
Makefile"
|
||||
_lib="log"
|
||||
subpackages="$pkgname-dev"
|
||||
builddir="$srcdir"/platform_system_core-android-$pkgver/lib${_lib}
|
||||
|
||||
prepare() {
|
||||
cp "$srcdir"/Makefile "$builddir"
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
# Library
|
||||
install -Dm644 "${builddir}/lib${_lib}.so" \
|
||||
"${pkgdir}/usr/lib/android/lib${_lib}.so"
|
||||
|
||||
# Header files
|
||||
mkdir -p "${pkgdir}/usr/include/android/"
|
||||
cp -r "${srcdir}/platform_system_core-android-${pkgver}/include/${_lib}" \
|
||||
"${pkgdir}/usr/include/android/"
|
||||
}
|
||||
|
||||
sha512sums="f84d31db61f86c73b8aecbaf788d43b0a2cc984121fd7244a2f7ca2a2a751437b8708acdd27cb86a260162e866c40f6015f14d52beb3a85e9ae2efd6f44b73f3 android_platform_system_core-7.0.0_r34.tar.gz
|
||||
967055ff34e1aa66cb76de0374be24810fab8a11b56a11c33fac0a7914def39884b1b6428b4deda5aa13a9f323d556479f25fa351220f2909c9fbfd72ca31a4b Makefile"
|
||||
@@ -0,0 +1,31 @@
|
||||
# From Android.mk: liblog_sources, liblog_host_sources, LOCAL_SRC_FILES_linux
|
||||
SRC_C := \
|
||||
config_write.c \
|
||||
event_tag_map.c \
|
||||
fake_log_device.c \
|
||||
fake_writer.c \
|
||||
log_event_list.c \
|
||||
log_event_write.c \
|
||||
logger_lock.c \
|
||||
logger_name.c \
|
||||
logger_write.c
|
||||
OBJECTS := $(SRC_C:%.c=%.o)
|
||||
CC := gcc
|
||||
LD := gcc
|
||||
LDFLAGS := -shared
|
||||
CFLAGS := -Wall -I../include -fPIC
|
||||
|
||||
all: liblog.so
|
||||
|
||||
%.o: %.c
|
||||
$(info CC $<)
|
||||
@$(CC) -c -o $@ $< $(CFLAGS)
|
||||
|
||||
liblog.so: $(OBJECTS)
|
||||
$(info LD $@)
|
||||
@$(LD) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
rm -v *.o liblog.so
|
||||
@@ -0,0 +1,24 @@
|
||||
diff --git a/include/hardware_legacy/power.h b/include/hardware_legacy/power.h
|
||||
new file mode 100644
|
||||
index 0000000..5aeb933
|
||||
--- /dev/null
|
||||
+++ b/include/hardware_legacy/power.h
|
||||
@@ -0,0 +1,18 @@
|
||||
+#pragma once
|
||||
+// This is a stub for wake locks, so we don't need to compile
|
||||
+// android_hardware_libhardware_legacy for now.
|
||||
+
|
||||
+#include <stdint.h>
|
||||
+
|
||||
+enum {
|
||||
+ PARTIAL_WAKE_LOCK = 1,
|
||||
+ FULL_WAKE_LOCK = 2
|
||||
+};
|
||||
+
|
||||
+int acquire_wake_lock(int lock, const char* id) {
|
||||
+ // STUB
|
||||
+};
|
||||
+
|
||||
+int release_wake_lock(const char* id) {
|
||||
+ // STUB
|
||||
+};
|
||||
@@ -0,0 +1,54 @@
|
||||
# NOTE: 8.x has a more complicated build process:
|
||||
# https://source.android.com/devices/architecture/hidl-cpp
|
||||
|
||||
pkgname=android-ril
|
||||
pkgver=7.0.0_r34
|
||||
pkgrel=0
|
||||
pkgdesc="Radio Interface Layer Daemon"
|
||||
url="https://github.com/android/platform_hardware_ril"
|
||||
arch="all"
|
||||
license="APACHE2"
|
||||
depends=""
|
||||
makedepends="nanopb nanopb-dev android-libcutils-dev"
|
||||
options="!check"
|
||||
# subpackages="librilutils libril"
|
||||
source="
|
||||
$pkgname-$pkgver.tar.gz::https://github.com/android/platform_hardware_ril/archive/android-${pkgver}.tar.gz
|
||||
rild.initd
|
||||
Makefile.libril
|
||||
Makefile.librilutils
|
||||
Makefile.rild
|
||||
01_wake_lock_stub.patch
|
||||
"
|
||||
builddir="$srcdir"/platform_hardware_ril-android-$pkgver
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
for i in librilutils libril rild; do
|
||||
cp "$srcdir"/Makefile.$i "$builddir"/$i/Makefile
|
||||
done
|
||||
}
|
||||
|
||||
build() {
|
||||
for i in librilutils libril rild; do
|
||||
msg "Building $i"
|
||||
cd "$builddir/$i"
|
||||
make
|
||||
done
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
|
||||
# OpenRC service
|
||||
install -Dm755 "$srcdir/rild.initd" "$pkgdir/etc/init.d/rild"
|
||||
}
|
||||
|
||||
|
||||
|
||||
sha512sums="7685958bbe628c761f568e0bd85f50ec6f7524945142c870aa1ad9ee5afc7e9db526b6aaa41fad71b584a7a048e1947c73ee8d61d588b0e5da5c8b56a30cc961 android-ril-7.0.0_r34.tar.gz
|
||||
f6b01eaf37412bfb5748a184f84b619a254d4a0bffc51613f74aef058fcea3f55d2e504ddacdf22463e2fca0ce71edc89be4e7de42fcc3761e2de8fc3a7316d5 rild.initd
|
||||
e85d424293b2bedc7b144cb29e8a0131b6ee385ec1c688a80b40d6836a93c4886b184c46880d74266f9c0b554be2b3da6c3836f3a6d05703f34c356ef284e970 Makefile.libril
|
||||
7a8b8da2aec6d91459c1641cf75f7a710b661814a4d447c58a361d67832d5237bbc6945be9a375a286b3137ef6bcd942689c1e0cc8c270b9fff91c2ca0ad1da7 Makefile.librilutils
|
||||
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e Makefile.rild
|
||||
5d0d7e79fc0454bf627917a8c9acd801760145c320a082933619f3eeb3f30bd832db7cab7d68f86e3b4217373ee6919365449af78675aea5005c53bb80594c6a 01_wake_lock_stub.patch"
|
||||
@@ -0,0 +1,21 @@
|
||||
CXX := g++
|
||||
CXXFLAGS := -std=c++14 -Wall -g -I../include -I/usr/include/android
|
||||
LIBS :=
|
||||
|
||||
SOURCES := ${wildcard *.cpp}
|
||||
OBJECTS := $(SOURCES:%.cpp=%.o)
|
||||
|
||||
all: libril.so
|
||||
|
||||
%.o: %.cpp
|
||||
@echo CC $<
|
||||
@$(CXX) -c -o $@ $< $(CXXFLAGS)
|
||||
|
||||
libril.so: $(OBJECTS)
|
||||
@echo LD $@
|
||||
@$(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
-rm -fv *.o libril.so
|
||||
@@ -0,0 +1,26 @@
|
||||
CC := gcc
|
||||
CFLAGS := -Wall -I../include/ -I. -fPIC
|
||||
|
||||
PBSRC := ${wildcard proto/*.proto}
|
||||
SRC := ${wildcard *.c} $(PBSRC:%.proto=%.pb-c.c)
|
||||
OBJ := $(SRC:%.c=%.o)
|
||||
|
||||
all: librilutils.so.1
|
||||
|
||||
%.pb-c.c: %.proto
|
||||
$(info PROTO $<)
|
||||
@protoc --nanopb_out=. $<
|
||||
|
||||
%.o: %.c
|
||||
$(info CC $<)
|
||||
@$(CC) -c -o $@ $< $(CFLAGS)
|
||||
|
||||
librilutils.so.1: $(OBJ) $(PBOBJ)
|
||||
$(info LD $@)
|
||||
@$(CC) -shared -Wl,-soname,$@.so.1 -o $@.so.1 $^ $(CFLAGS)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
-rm -v *.o *.so proto/*.pb-c.*
|
||||
|
||||
Whitespace-only changes.
@@ -0,0 +1,18 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2009 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Purpose License v2
|
||||
|
||||
depend() {
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting Radio Interface Layer"
|
||||
start-stop-daemon --start --quiet --exec /usr/sbin/rild
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping Radio Interface Layer"
|
||||
start-stop-daemon --stop --quiet --exec /usr/sbin/rild
|
||||
eend $?
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
pkgname=nanopb
|
||||
pkgver=0.3.9
|
||||
pkgrel=1
|
||||
pkgdesc="Protocol Buffers with small code size"
|
||||
url="https://jpa.kapsi.fi/nanopb"
|
||||
arch="all"
|
||||
license="MIT"
|
||||
depends="py2-protobuf"
|
||||
makedepends="cmake python2 protobuf"
|
||||
subpackages="$pkgname-dev"
|
||||
source="$pkgname-$pkgver.tar.gz::https://github.com/nanopb/nanopb/archive/${pkgver}.tar.gz"
|
||||
options="!check"
|
||||
|
||||
builddir="$srcdir"/$pkgname-$pkgver
|
||||
build() {
|
||||
cd "$builddir"
|
||||
cmake -DCMAKE_BUILD_TYPE=Release
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
|
||||
# Statically linked library
|
||||
install -Dm644 libprotobuf-nanopb.a "$pkgdir"/usr/lib/libprotobuf-nanopb.a
|
||||
|
||||
# Header files
|
||||
for i in *.h; do
|
||||
install -Dm644 "$i" "$pkgdir/usr/include/$i"
|
||||
done
|
||||
|
||||
# Protobuf plugin
|
||||
for i in nanopb_generator.py protoc-gen-nanopb; do
|
||||
install -Dm755 "generator/$i" "$pkgdir/usr/bin/$i"
|
||||
done
|
||||
|
||||
# Protocol definitions for generator
|
||||
make -C generator/proto
|
||||
for i in __init__.py nanopb_pb2.py plugin_pb2.py; do
|
||||
echo "installing $i"
|
||||
install -Dm755 "generator/proto/$i" "$pkgdir/usr/lib/python2.7/proto/$i"
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
sha512sums="1fa18d69ebfba2a58214beebd31fbbdd1edd71a19978754288adc09be6d5782feeb7bab2916448add2ab5bf7072d377101c7441b3e74619339dc545df3a73275 nanopb-0.3.9.tar.gz"
|
||||
@@ -0,0 +1,43 @@
|
||||
# This package gets installed in the native and foreign arch chroots.
|
||||
# It creates files like /usr/lib/arch-bin-masquerade/armhf/gcc, which
|
||||
# point in the native chroot to the armhf-cross-compiler, and in the
|
||||
# armhf chroot to /usr/bin/gcc. That way compilation works fine, even
|
||||
# when distcc gets the absolute path to the compiler passed (ccache does
|
||||
# that).
|
||||
|
||||
pkgname=arch-bin-masquerade
|
||||
pkgver=1
|
||||
pkgrel=0
|
||||
pkgdesc="Wrappers for ccache + distcc (native and foreign chroots)"
|
||||
url="https://postmarketOS.org"
|
||||
arch="all"
|
||||
license="MIT"
|
||||
options="!check !tracedeps"
|
||||
|
||||
package() {
|
||||
# Architectures and binaries
|
||||
_archs="x86_64 armhf aarch64"
|
||||
_bins="c++ cc cpp g++ gcc"
|
||||
|
||||
# Iterate over architectures
|
||||
for _arch in $_archs; do
|
||||
# Create the arch-specific bin folder
|
||||
_hostspec="$(arch_to_hostspec $_arch)"
|
||||
_bindir="$pkgdir/usr/lib/arch-bin-masquerade/$_arch"
|
||||
mkdir -p "$_bindir"
|
||||
cd "$_bindir"
|
||||
|
||||
# Iterate over binaries and create wrappers
|
||||
for _bin in $_bins; do
|
||||
{
|
||||
echo "#!/bin/sh"
|
||||
if [ "$_arch" == "$CARCH" ]; then
|
||||
echo "exec /usr/bin/${_bin} \"\$@\""
|
||||
else
|
||||
echo "exec /usr/bin/${_hostspec}-${_bin} \"\$@\""
|
||||
fi
|
||||
} > "$_bin"
|
||||
chmod +x "$_bin"
|
||||
done
|
||||
done
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen binutils-aarch64
|
||||
# Based on: main/binutils
|
||||
|
||||
|
||||
pkgname="binutils-aarch64"
|
||||
pkgver=2.31.1
|
||||
pkgrel=0
|
||||
pkgdesc="Tools necessary to build programs for aarch64 targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
depends=""
|
||||
makedepends_build=""
|
||||
makedepends_host=""
|
||||
makedepends="gettext libtool autoconf automake bison"
|
||||
arch="armhf x86_64 x86"
|
||||
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
|
||||
subpackages=""
|
||||
source="http://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2
|
||||
binutils-ld-fix-static-linking.patch
|
||||
gold-mips.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
pkgname="binutils-$CTARGET_ARCH"
|
||||
subpackages=""
|
||||
sonameprefix="binutils:"
|
||||
fi
|
||||
|
||||
# secfixes:
|
||||
# 2.28-r1:
|
||||
# - CVE-2017-7614
|
||||
|
||||
build() {
|
||||
_target="$(arch_to_hostspec aarch64)"
|
||||
cd "$builddir"
|
||||
"$builddir"/configure \
|
||||
--build="$CBUILD" \
|
||||
--target=$_target \
|
||||
--with-lib-path=/usr/lib \
|
||||
--prefix=/usr \
|
||||
--with-sysroot=/usr/$_target \
|
||||
--enable-ld=default \
|
||||
--enable-gold=yes \
|
||||
--enable-plugins \
|
||||
--enable-deterministic-archives \
|
||||
--disable-multilib \
|
||||
--disable-werror \
|
||||
--disable-nls
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
make install DESTDIR="$pkgdir"
|
||||
|
||||
# remove man, info folders
|
||||
rm -rf "$pkgdir"/usr/share
|
||||
}
|
||||
|
||||
|
||||
|
||||
sha512sums="b42954e6f49a0adcd2676bdd77dfb59bfc25cec8184b007521d1e2b1d5d0593b58639e3d9448d5a40fe024c3cea386a37743627d6bb16d502f52a4a32b9573bd binutils-2.31.1.tar.bz2
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch"
|
||||
@@ -0,0 +1,46 @@
|
||||
This fixes static linking for our hardened toolchain
|
||||
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
|
||||
index e8126cb..9532bfb 100644
|
||||
--- a/ld/scripttempl/elf.sc
|
||||
+++ b/ld/scripttempl/elf.sc
|
||||
@@ -235,8 +235,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
|
||||
if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
|
||||
SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
|
||||
SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
|
||||
- CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors"
|
||||
- DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors"
|
||||
+ CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .ctors"
|
||||
+ DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .dtors"
|
||||
else
|
||||
SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
|
||||
SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
|
||||
@@ -270,15 +270,14 @@ CTOR=".ctors ${CONSTRUCTING-0} :
|
||||
doesn't matter which directory crtbegin.o
|
||||
is in. */
|
||||
|
||||
- KEEP (*crtbegin.o(.ctors))
|
||||
- KEEP (*crtbegin?.o(.ctors))
|
||||
+ KEEP (*crtbegin*.o(.ctors))
|
||||
|
||||
/* We don't want to include the .ctor section from
|
||||
the crtend.o file until after the sorted ctors.
|
||||
The .ctor section from the crtend file contains the
|
||||
end of ctors marker and it must be last */
|
||||
|
||||
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
|
||||
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
${CONSTRUCTING+${CTOR_END}}
|
||||
@@ -286,9 +285,8 @@ CTOR=".ctors ${CONSTRUCTING-0} :
|
||||
DTOR=".dtors ${CONSTRUCTING-0} :
|
||||
{
|
||||
${CONSTRUCTING+${DTOR_START}}
|
||||
- KEEP (*crtbegin.o(.dtors))
|
||||
- KEEP (*crtbegin?.o(.dtors))
|
||||
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
|
||||
+ KEEP (*crtbegin*.o(.dtors))
|
||||
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
${CONSTRUCTING+${DTOR_END}}
|
||||
@@ -0,0 +1,93 @@
|
||||
From d66deb71f1537e2e30dccdfda22eed5d46ec47eb Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Wed, 14 Mar 2018 22:09:33 +1030
|
||||
Subject: [PATCH] PowerPC64 debian bug 886264, out-of-line save/restore
|
||||
functions
|
||||
|
||||
This calculation in relocate_section
|
||||
|
||||
if (stub_entry->stub_type == ppc_stub_save_res)
|
||||
relocation += (stub_sec->output_offset
|
||||
+ stub_sec->output_section->vma
|
||||
+ stub_sec->size - htab->sfpr->size
|
||||
- htab->sfpr->output_offset
|
||||
- htab->sfpr->output_section->vma);
|
||||
|
||||
to adjust from the original out-of-line save/restore function address
|
||||
in sfpr to a copy at the end of stub_sec goes wrong when stub_sec is
|
||||
padded, because the copy is no longer at the end of stub_sec. The
|
||||
solution is to pad before copying sfpr, so the copy is always at the
|
||||
end of stub_sec.
|
||||
|
||||
* elf64-ppc.c (sfpr_define): Adjust for stub_sec size having
|
||||
sfpr size added before defining alias symbols.
|
||||
(ppc64_elf_build_stubs): Add stub section padding before
|
||||
copying sfpr contents and defining save/restore alias symbols.
|
||||
|
||||
(cherry picked from commit 7dda8d3cf3b089bb7e03c4cdbec827fc6a188c88)
|
||||
---
|
||||
bfd/ChangeLog | 9 +++++++++
|
||||
bfd/elf64-ppc.c | 33 ++++++++++++++++++---------------
|
||||
2 files changed, 27 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
|
||||
index 6fcdff0..039294f 100644
|
||||
--- a/bfd/elf64-ppc.c
|
||||
+++ b/bfd/elf64-ppc.c
|
||||
@@ -6645,7 +6645,7 @@ sfpr_define (struct bfd_link_info *info,
|
||||
{
|
||||
s->root.type = bfd_link_hash_defined;
|
||||
s->root.u.def.section = stub_sec;
|
||||
- s->root.u.def.value = (stub_sec->size
|
||||
+ s->root.u.def.value = (stub_sec->size - htab->sfpr->size
|
||||
+ h->elf.root.u.def.value);
|
||||
s->ref_regular = 1;
|
||||
s->def_regular = 1;
|
||||
@@ -13232,20 +13232,7 @@ ppc64_elf_build_stubs (struct bfd_link_info *info,
|
||||
|
||||
for (group = htab->group; group != NULL; group = group->next)
|
||||
if (group->needs_save_res)
|
||||
- {
|
||||
- stub_sec = group->stub_sec;
|
||||
- memcpy (stub_sec->contents + stub_sec->size, htab->sfpr->contents,
|
||||
- htab->sfpr->size);
|
||||
- if (htab->params->emit_stub_syms)
|
||||
- {
|
||||
- unsigned int i;
|
||||
-
|
||||
- for (i = 0; i < ARRAY_SIZE (save_res_funcs); i++)
|
||||
- if (!sfpr_define (info, &save_res_funcs[i], stub_sec))
|
||||
- return FALSE;
|
||||
- }
|
||||
- stub_sec->size += htab->sfpr->size;
|
||||
- }
|
||||
+ group->stub_sec->size += htab->sfpr->size;
|
||||
|
||||
if (htab->relbrlt != NULL)
|
||||
htab->relbrlt->reloc_count = 0;
|
||||
@@ -13259,6 +13246,22 @@ ppc64_elf_build_stubs (struct bfd_link_info *info,
|
||||
}
|
||||
|
||||
for (group = htab->group; group != NULL; group = group->next)
|
||||
+ if (group->needs_save_res)
|
||||
+ {
|
||||
+ stub_sec = group->stub_sec;
|
||||
+ memcpy (stub_sec->contents + stub_sec->size - htab->sfpr->size,
|
||||
+ htab->sfpr->contents, htab->sfpr->size);
|
||||
+ if (htab->params->emit_stub_syms)
|
||||
+ {
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE (save_res_funcs); i++)
|
||||
+ if (!sfpr_define (info, &save_res_funcs[i], stub_sec))
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ for (group = htab->group; group != NULL; group = group->next)
|
||||
if ((stub_sec = group->stub_sec) != NULL)
|
||||
{
|
||||
stub_sec_count += 1;
|
||||
--
|
||||
2.9.3
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
# DP: Fix gold on mips64 targets.
|
||||
|
||||
gold/
|
||||
|
||||
2016-08-09 Aurelien Jarno <aurelien@aurel32.net>
|
||||
|
||||
* configure.tgt: Add mips64el*-*-*|mips64le*-*-* and mips64*-*-*.
|
||||
|
||||
|
||||
--- a/gold/configure.tgt
|
||||
+++ b/gold/configure.tgt
|
||||
@@ -153,6 +153,13 @@ aarch64*-*)
|
||||
targ_big_endian=false
|
||||
targ_extra_big_endian=true
|
||||
;;
|
||||
+mips*64*el*-*-*|mips*64*le*-*-*)
|
||||
+ targ_obj=mips
|
||||
+ targ_machine=EM_MIPS_RS3_LE
|
||||
+ targ_size=64
|
||||
+ targ_big_endian=false
|
||||
+ targ_extra_big_endian=true
|
||||
+ ;;
|
||||
mips*el*-*-*|mips*le*-*-*)
|
||||
targ_obj=mips
|
||||
targ_machine=EM_MIPS_RS3_LE
|
||||
@@ -160,6 +167,13 @@ mips*el*-*-*|mips*le*-*-*)
|
||||
targ_big_endian=false
|
||||
targ_extra_big_endian=true
|
||||
;;
|
||||
+mips*64*-*-*)
|
||||
+ targ_obj=mips
|
||||
+ targ_machine=EM_MIPS
|
||||
+ targ_size=64
|
||||
+ targ_big_endian=true
|
||||
+ targ_extra_big_endian=false
|
||||
+ ;;
|
||||
mips*-*-*)
|
||||
targ_obj=mips
|
||||
targ_machine=EM_MIPS
|
||||
@@ -0,0 +1,65 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen binutils-armhf
|
||||
# Based on: main/binutils
|
||||
|
||||
|
||||
pkgname="binutils-armhf"
|
||||
pkgver=2.31.1
|
||||
pkgrel=0
|
||||
pkgdesc="Tools necessary to build programs for armhf targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
depends=""
|
||||
makedepends_build=""
|
||||
makedepends_host=""
|
||||
makedepends="gettext libtool autoconf automake bison"
|
||||
arch="aarch64 x86_64 x86"
|
||||
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
|
||||
subpackages=""
|
||||
source="http://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2
|
||||
binutils-ld-fix-static-linking.patch
|
||||
gold-mips.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
pkgname="binutils-$CTARGET_ARCH"
|
||||
subpackages=""
|
||||
sonameprefix="binutils:"
|
||||
fi
|
||||
|
||||
# secfixes:
|
||||
# 2.28-r1:
|
||||
# - CVE-2017-7614
|
||||
|
||||
build() {
|
||||
_target="$(arch_to_hostspec armhf)"
|
||||
cd "$builddir"
|
||||
"$builddir"/configure \
|
||||
--build="$CBUILD" \
|
||||
--target=$_target \
|
||||
--with-lib-path=/usr/lib \
|
||||
--prefix=/usr \
|
||||
--with-sysroot=/usr/$_target \
|
||||
--enable-ld=default \
|
||||
--enable-gold=yes \
|
||||
--enable-plugins \
|
||||
--enable-deterministic-archives \
|
||||
--disable-multilib \
|
||||
--disable-werror \
|
||||
--disable-nls
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
make install DESTDIR="$pkgdir"
|
||||
|
||||
# remove man, info folders
|
||||
rm -rf "$pkgdir"/usr/share
|
||||
}
|
||||
|
||||
|
||||
|
||||
sha512sums="b42954e6f49a0adcd2676bdd77dfb59bfc25cec8184b007521d1e2b1d5d0593b58639e3d9448d5a40fe024c3cea386a37743627d6bb16d502f52a4a32b9573bd binutils-2.31.1.tar.bz2
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch"
|
||||
@@ -0,0 +1,46 @@
|
||||
This fixes static linking for our hardened toolchain
|
||||
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
|
||||
index e8126cb..9532bfb 100644
|
||||
--- a/ld/scripttempl/elf.sc
|
||||
+++ b/ld/scripttempl/elf.sc
|
||||
@@ -235,8 +235,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
|
||||
if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
|
||||
SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
|
||||
SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
|
||||
- CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors"
|
||||
- DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors"
|
||||
+ CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .ctors"
|
||||
+ DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .dtors"
|
||||
else
|
||||
SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
|
||||
SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
|
||||
@@ -270,15 +270,14 @@ CTOR=".ctors ${CONSTRUCTING-0} :
|
||||
doesn't matter which directory crtbegin.o
|
||||
is in. */
|
||||
|
||||
- KEEP (*crtbegin.o(.ctors))
|
||||
- KEEP (*crtbegin?.o(.ctors))
|
||||
+ KEEP (*crtbegin*.o(.ctors))
|
||||
|
||||
/* We don't want to include the .ctor section from
|
||||
the crtend.o file until after the sorted ctors.
|
||||
The .ctor section from the crtend file contains the
|
||||
end of ctors marker and it must be last */
|
||||
|
||||
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
|
||||
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
${CONSTRUCTING+${CTOR_END}}
|
||||
@@ -286,9 +285,8 @@ CTOR=".ctors ${CONSTRUCTING-0} :
|
||||
DTOR=".dtors ${CONSTRUCTING-0} :
|
||||
{
|
||||
${CONSTRUCTING+${DTOR_START}}
|
||||
- KEEP (*crtbegin.o(.dtors))
|
||||
- KEEP (*crtbegin?.o(.dtors))
|
||||
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
|
||||
+ KEEP (*crtbegin*.o(.dtors))
|
||||
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
${CONSTRUCTING+${DTOR_END}}
|
||||
@@ -0,0 +1,93 @@
|
||||
From d66deb71f1537e2e30dccdfda22eed5d46ec47eb Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Wed, 14 Mar 2018 22:09:33 +1030
|
||||
Subject: [PATCH] PowerPC64 debian bug 886264, out-of-line save/restore
|
||||
functions
|
||||
|
||||
This calculation in relocate_section
|
||||
|
||||
if (stub_entry->stub_type == ppc_stub_save_res)
|
||||
relocation += (stub_sec->output_offset
|
||||
+ stub_sec->output_section->vma
|
||||
+ stub_sec->size - htab->sfpr->size
|
||||
- htab->sfpr->output_offset
|
||||
- htab->sfpr->output_section->vma);
|
||||
|
||||
to adjust from the original out-of-line save/restore function address
|
||||
in sfpr to a copy at the end of stub_sec goes wrong when stub_sec is
|
||||
padded, because the copy is no longer at the end of stub_sec. The
|
||||
solution is to pad before copying sfpr, so the copy is always at the
|
||||
end of stub_sec.
|
||||
|
||||
* elf64-ppc.c (sfpr_define): Adjust for stub_sec size having
|
||||
sfpr size added before defining alias symbols.
|
||||
(ppc64_elf_build_stubs): Add stub section padding before
|
||||
copying sfpr contents and defining save/restore alias symbols.
|
||||
|
||||
(cherry picked from commit 7dda8d3cf3b089bb7e03c4cdbec827fc6a188c88)
|
||||
---
|
||||
bfd/ChangeLog | 9 +++++++++
|
||||
bfd/elf64-ppc.c | 33 ++++++++++++++++++---------------
|
||||
2 files changed, 27 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
|
||||
index 6fcdff0..039294f 100644
|
||||
--- a/bfd/elf64-ppc.c
|
||||
+++ b/bfd/elf64-ppc.c
|
||||
@@ -6645,7 +6645,7 @@ sfpr_define (struct bfd_link_info *info,
|
||||
{
|
||||
s->root.type = bfd_link_hash_defined;
|
||||
s->root.u.def.section = stub_sec;
|
||||
- s->root.u.def.value = (stub_sec->size
|
||||
+ s->root.u.def.value = (stub_sec->size - htab->sfpr->size
|
||||
+ h->elf.root.u.def.value);
|
||||
s->ref_regular = 1;
|
||||
s->def_regular = 1;
|
||||
@@ -13232,20 +13232,7 @@ ppc64_elf_build_stubs (struct bfd_link_info *info,
|
||||
|
||||
for (group = htab->group; group != NULL; group = group->next)
|
||||
if (group->needs_save_res)
|
||||
- {
|
||||
- stub_sec = group->stub_sec;
|
||||
- memcpy (stub_sec->contents + stub_sec->size, htab->sfpr->contents,
|
||||
- htab->sfpr->size);
|
||||
- if (htab->params->emit_stub_syms)
|
||||
- {
|
||||
- unsigned int i;
|
||||
-
|
||||
- for (i = 0; i < ARRAY_SIZE (save_res_funcs); i++)
|
||||
- if (!sfpr_define (info, &save_res_funcs[i], stub_sec))
|
||||
- return FALSE;
|
||||
- }
|
||||
- stub_sec->size += htab->sfpr->size;
|
||||
- }
|
||||
+ group->stub_sec->size += htab->sfpr->size;
|
||||
|
||||
if (htab->relbrlt != NULL)
|
||||
htab->relbrlt->reloc_count = 0;
|
||||
@@ -13259,6 +13246,22 @@ ppc64_elf_build_stubs (struct bfd_link_info *info,
|
||||
}
|
||||
|
||||
for (group = htab->group; group != NULL; group = group->next)
|
||||
+ if (group->needs_save_res)
|
||||
+ {
|
||||
+ stub_sec = group->stub_sec;
|
||||
+ memcpy (stub_sec->contents + stub_sec->size - htab->sfpr->size,
|
||||
+ htab->sfpr->contents, htab->sfpr->size);
|
||||
+ if (htab->params->emit_stub_syms)
|
||||
+ {
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE (save_res_funcs); i++)
|
||||
+ if (!sfpr_define (info, &save_res_funcs[i], stub_sec))
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ for (group = htab->group; group != NULL; group = group->next)
|
||||
if ((stub_sec = group->stub_sec) != NULL)
|
||||
{
|
||||
stub_sec_count += 1;
|
||||
--
|
||||
2.9.3
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
# DP: Fix gold on mips64 targets.
|
||||
|
||||
gold/
|
||||
|
||||
2016-08-09 Aurelien Jarno <aurelien@aurel32.net>
|
||||
|
||||
* configure.tgt: Add mips64el*-*-*|mips64le*-*-* and mips64*-*-*.
|
||||
|
||||
|
||||
--- a/gold/configure.tgt
|
||||
+++ b/gold/configure.tgt
|
||||
@@ -153,6 +153,13 @@ aarch64*-*)
|
||||
targ_big_endian=false
|
||||
targ_extra_big_endian=true
|
||||
;;
|
||||
+mips*64*el*-*-*|mips*64*le*-*-*)
|
||||
+ targ_obj=mips
|
||||
+ targ_machine=EM_MIPS_RS3_LE
|
||||
+ targ_size=64
|
||||
+ targ_big_endian=false
|
||||
+ targ_extra_big_endian=true
|
||||
+ ;;
|
||||
mips*el*-*-*|mips*le*-*-*)
|
||||
targ_obj=mips
|
||||
targ_machine=EM_MIPS_RS3_LE
|
||||
@@ -160,6 +167,13 @@ mips*el*-*-*|mips*le*-*-*)
|
||||
targ_big_endian=false
|
||||
targ_extra_big_endian=true
|
||||
;;
|
||||
+mips*64*-*-*)
|
||||
+ targ_obj=mips
|
||||
+ targ_machine=EM_MIPS
|
||||
+ targ_size=64
|
||||
+ targ_big_endian=true
|
||||
+ targ_extra_big_endian=false
|
||||
+ ;;
|
||||
mips*-*-*)
|
||||
targ_obj=mips
|
||||
targ_machine=EM_MIPS
|
||||
@@ -0,0 +1,65 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen binutils-x86_64
|
||||
# Based on: main/binutils
|
||||
|
||||
|
||||
pkgname="binutils-x86_64"
|
||||
pkgver=2.31.1
|
||||
pkgrel=0
|
||||
pkgdesc="Tools necessary to build programs for x86_64 targets"
|
||||
url="https://www.gnu.org/software/binutils/"
|
||||
depends=""
|
||||
makedepends_build=""
|
||||
makedepends_host=""
|
||||
makedepends="gettext libtool autoconf automake bison"
|
||||
arch="armhf aarch64 x86"
|
||||
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
|
||||
subpackages=""
|
||||
source="http://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2
|
||||
binutils-ld-fix-static-linking.patch
|
||||
gold-mips.patch
|
||||
"
|
||||
builddir="$srcdir/binutils-$pkgver"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
pkgname="binutils-$CTARGET_ARCH"
|
||||
subpackages=""
|
||||
sonameprefix="binutils:"
|
||||
fi
|
||||
|
||||
# secfixes:
|
||||
# 2.28-r1:
|
||||
# - CVE-2017-7614
|
||||
|
||||
build() {
|
||||
_target="$(arch_to_hostspec x86_64)"
|
||||
cd "$builddir"
|
||||
"$builddir"/configure \
|
||||
--build="$CBUILD" \
|
||||
--target=$_target \
|
||||
--with-lib-path=/usr/lib \
|
||||
--prefix=/usr \
|
||||
--with-sysroot=/usr/$_target \
|
||||
--enable-ld=default \
|
||||
--enable-gold=yes \
|
||||
--enable-plugins \
|
||||
--enable-deterministic-archives \
|
||||
--disable-multilib \
|
||||
--disable-werror \
|
||||
--disable-nls
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
make install DESTDIR="$pkgdir"
|
||||
|
||||
# remove man, info folders
|
||||
rm -rf "$pkgdir"/usr/share
|
||||
}
|
||||
|
||||
|
||||
|
||||
sha512sums="b42954e6f49a0adcd2676bdd77dfb59bfc25cec8184b007521d1e2b1d5d0593b58639e3d9448d5a40fe024c3cea386a37743627d6bb16d502f52a4a32b9573bd binutils-2.31.1.tar.bz2
|
||||
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
|
||||
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch"
|
||||
@@ -0,0 +1,46 @@
|
||||
This fixes static linking for our hardened toolchain
|
||||
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
|
||||
index e8126cb..9532bfb 100644
|
||||
--- a/ld/scripttempl/elf.sc
|
||||
+++ b/ld/scripttempl/elf.sc
|
||||
@@ -235,8 +235,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
|
||||
if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
|
||||
SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
|
||||
SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
|
||||
- CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors"
|
||||
- DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors"
|
||||
+ CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .ctors"
|
||||
+ DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .dtors"
|
||||
else
|
||||
SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
|
||||
SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
|
||||
@@ -270,15 +270,14 @@ CTOR=".ctors ${CONSTRUCTING-0} :
|
||||
doesn't matter which directory crtbegin.o
|
||||
is in. */
|
||||
|
||||
- KEEP (*crtbegin.o(.ctors))
|
||||
- KEEP (*crtbegin?.o(.ctors))
|
||||
+ KEEP (*crtbegin*.o(.ctors))
|
||||
|
||||
/* We don't want to include the .ctor section from
|
||||
the crtend.o file until after the sorted ctors.
|
||||
The .ctor section from the crtend file contains the
|
||||
end of ctors marker and it must be last */
|
||||
|
||||
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
|
||||
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
${CONSTRUCTING+${CTOR_END}}
|
||||
@@ -286,9 +285,8 @@ CTOR=".ctors ${CONSTRUCTING-0} :
|
||||
DTOR=".dtors ${CONSTRUCTING-0} :
|
||||
{
|
||||
${CONSTRUCTING+${DTOR_START}}
|
||||
- KEEP (*crtbegin.o(.dtors))
|
||||
- KEEP (*crtbegin?.o(.dtors))
|
||||
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
|
||||
+ KEEP (*crtbegin*.o(.dtors))
|
||||
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
${CONSTRUCTING+${DTOR_END}}
|
||||
@@ -0,0 +1,93 @@
|
||||
From d66deb71f1537e2e30dccdfda22eed5d46ec47eb Mon Sep 17 00:00:00 2001
|
||||
From: Alan Modra <amodra@gmail.com>
|
||||
Date: Wed, 14 Mar 2018 22:09:33 +1030
|
||||
Subject: [PATCH] PowerPC64 debian bug 886264, out-of-line save/restore
|
||||
functions
|
||||
|
||||
This calculation in relocate_section
|
||||
|
||||
if (stub_entry->stub_type == ppc_stub_save_res)
|
||||
relocation += (stub_sec->output_offset
|
||||
+ stub_sec->output_section->vma
|
||||
+ stub_sec->size - htab->sfpr->size
|
||||
- htab->sfpr->output_offset
|
||||
- htab->sfpr->output_section->vma);
|
||||
|
||||
to adjust from the original out-of-line save/restore function address
|
||||
in sfpr to a copy at the end of stub_sec goes wrong when stub_sec is
|
||||
padded, because the copy is no longer at the end of stub_sec. The
|
||||
solution is to pad before copying sfpr, so the copy is always at the
|
||||
end of stub_sec.
|
||||
|
||||
* elf64-ppc.c (sfpr_define): Adjust for stub_sec size having
|
||||
sfpr size added before defining alias symbols.
|
||||
(ppc64_elf_build_stubs): Add stub section padding before
|
||||
copying sfpr contents and defining save/restore alias symbols.
|
||||
|
||||
(cherry picked from commit 7dda8d3cf3b089bb7e03c4cdbec827fc6a188c88)
|
||||
---
|
||||
bfd/ChangeLog | 9 +++++++++
|
||||
bfd/elf64-ppc.c | 33 ++++++++++++++++++---------------
|
||||
2 files changed, 27 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
|
||||
index 6fcdff0..039294f 100644
|
||||
--- a/bfd/elf64-ppc.c
|
||||
+++ b/bfd/elf64-ppc.c
|
||||
@@ -6645,7 +6645,7 @@ sfpr_define (struct bfd_link_info *info,
|
||||
{
|
||||
s->root.type = bfd_link_hash_defined;
|
||||
s->root.u.def.section = stub_sec;
|
||||
- s->root.u.def.value = (stub_sec->size
|
||||
+ s->root.u.def.value = (stub_sec->size - htab->sfpr->size
|
||||
+ h->elf.root.u.def.value);
|
||||
s->ref_regular = 1;
|
||||
s->def_regular = 1;
|
||||
@@ -13232,20 +13232,7 @@ ppc64_elf_build_stubs (struct bfd_link_info *info,
|
||||
|
||||
for (group = htab->group; group != NULL; group = group->next)
|
||||
if (group->needs_save_res)
|
||||
- {
|
||||
- stub_sec = group->stub_sec;
|
||||
- memcpy (stub_sec->contents + stub_sec->size, htab->sfpr->contents,
|
||||
- htab->sfpr->size);
|
||||
- if (htab->params->emit_stub_syms)
|
||||
- {
|
||||
- unsigned int i;
|
||||
-
|
||||
- for (i = 0; i < ARRAY_SIZE (save_res_funcs); i++)
|
||||
- if (!sfpr_define (info, &save_res_funcs[i], stub_sec))
|
||||
- return FALSE;
|
||||
- }
|
||||
- stub_sec->size += htab->sfpr->size;
|
||||
- }
|
||||
+ group->stub_sec->size += htab->sfpr->size;
|
||||
|
||||
if (htab->relbrlt != NULL)
|
||||
htab->relbrlt->reloc_count = 0;
|
||||
@@ -13259,6 +13246,22 @@ ppc64_elf_build_stubs (struct bfd_link_info *info,
|
||||
}
|
||||
|
||||
for (group = htab->group; group != NULL; group = group->next)
|
||||
+ if (group->needs_save_res)
|
||||
+ {
|
||||
+ stub_sec = group->stub_sec;
|
||||
+ memcpy (stub_sec->contents + stub_sec->size - htab->sfpr->size,
|
||||
+ htab->sfpr->contents, htab->sfpr->size);
|
||||
+ if (htab->params->emit_stub_syms)
|
||||
+ {
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE (save_res_funcs); i++)
|
||||
+ if (!sfpr_define (info, &save_res_funcs[i], stub_sec))
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ for (group = htab->group; group != NULL; group = group->next)
|
||||
if ((stub_sec = group->stub_sec) != NULL)
|
||||
{
|
||||
stub_sec_count += 1;
|
||||
--
|
||||
2.9.3
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
# DP: Fix gold on mips64 targets.
|
||||
|
||||
gold/
|
||||
|
||||
2016-08-09 Aurelien Jarno <aurelien@aurel32.net>
|
||||
|
||||
* configure.tgt: Add mips64el*-*-*|mips64le*-*-* and mips64*-*-*.
|
||||
|
||||
|
||||
--- a/gold/configure.tgt
|
||||
+++ b/gold/configure.tgt
|
||||
@@ -153,6 +153,13 @@ aarch64*-*)
|
||||
targ_big_endian=false
|
||||
targ_extra_big_endian=true
|
||||
;;
|
||||
+mips*64*el*-*-*|mips*64*le*-*-*)
|
||||
+ targ_obj=mips
|
||||
+ targ_machine=EM_MIPS_RS3_LE
|
||||
+ targ_size=64
|
||||
+ targ_big_endian=false
|
||||
+ targ_extra_big_endian=true
|
||||
+ ;;
|
||||
mips*el*-*-*|mips*le*-*-*)
|
||||
targ_obj=mips
|
||||
targ_machine=EM_MIPS_RS3_LE
|
||||
@@ -160,6 +167,13 @@ mips*el*-*-*|mips*le*-*-*)
|
||||
targ_big_endian=false
|
||||
targ_extra_big_endian=true
|
||||
;;
|
||||
+mips*64*-*-*)
|
||||
+ targ_obj=mips
|
||||
+ targ_machine=EM_MIPS
|
||||
+ targ_size=64
|
||||
+ targ_big_endian=true
|
||||
+ targ_extra_big_endian=false
|
||||
+ ;;
|
||||
mips*-*-*)
|
||||
targ_obj=mips
|
||||
targ_machine=EM_MIPS
|
||||
@@ -0,0 +1,29 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen busybox-static-aarch64
|
||||
|
||||
pkgname=busybox-static-aarch64
|
||||
pkgver=1.28.4
|
||||
pkgrel=2
|
||||
|
||||
_arch="aarch64"
|
||||
_mirror="http://dl-cdn.alpinelinux.org/alpine/"
|
||||
|
||||
url="http://busybox.net"
|
||||
license="GPL2"
|
||||
arch="all"
|
||||
options="!check !strip"
|
||||
pkgdesc="Statically linked Busybox for $_arch"
|
||||
_target="$(arch_to_hostspec $_arch)"
|
||||
|
||||
source="
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
"
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir/usr/$_target"
|
||||
cd "$pkgdir/usr/$_target"
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
}
|
||||
|
||||
sha512sums="363f13a3041a65ee96c984f75e46e3b0af985de3ca312b109ee2fbcfea957a69fe75655d3138ca922f8e196fa97c56c7c8a387440962150874a2cc619f07e8b6 busybox-static-1.28.4-r2-aarch64.apk"
|
||||
@@ -0,0 +1,29 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen busybox-static-armhf
|
||||
|
||||
pkgname=busybox-static-armhf
|
||||
pkgver=1.28.4
|
||||
pkgrel=2
|
||||
|
||||
_arch="armhf"
|
||||
_mirror="http://dl-cdn.alpinelinux.org/alpine/"
|
||||
|
||||
url="http://busybox.net"
|
||||
license="GPL2"
|
||||
arch="all"
|
||||
options="!check !strip"
|
||||
pkgdesc="Statically linked Busybox for $_arch"
|
||||
_target="$(arch_to_hostspec $_arch)"
|
||||
|
||||
source="
|
||||
busybox-static-$pkgver-r$pkgrel-$_arch.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
|
||||
"
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir/usr/$_target"
|
||||
cd "$pkgdir/usr/$_target"
|
||||
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch.apk
|
||||
rm .PKGINFO .SIGN.*
|
||||
}
|
||||
|
||||
sha512sums="e10a339969fee47103d567d4a24237371a13a8519c40c550e64c3129018ff0fbd3bea785391c921087631bf0857e4a2ac46862fd699052f6a0752fb6e5771024 busybox-static-1.28.4-r2-armhf.apk"
|
||||
@@ -0,0 +1,27 @@
|
||||
# This package gets installed in the native chroot only. When cross-
|
||||
# compiling packages in the native chroot (e.g. kernel packages), the
|
||||
# cross-compiler does not get called directly, but wrapped through
|
||||
# ccache, which can then cache the results.
|
||||
|
||||
pkgname=ccache-cross-symlinks
|
||||
pkgver=1
|
||||
pkgrel=4
|
||||
pkgdesc="Enable ccache for cross-compilers with symlinks"
|
||||
url="https://ccache.samba.org/"
|
||||
arch="noarch"
|
||||
license="MIT"
|
||||
depends="ccache"
|
||||
options="!check"
|
||||
|
||||
package() {
|
||||
local _archs="armhf aarch64"
|
||||
local _bins="c++ cc cpp g++ gcc"
|
||||
mkdir -p "$pkgdir/usr/lib/ccache/bin"
|
||||
cd "$pkgdir/usr/lib/ccache/bin"
|
||||
for _arch in $_archs; do
|
||||
_hostspec="$(arch_to_hostspec $_arch)"
|
||||
for _bin in $_bins; do
|
||||
ln -v -s /usr/bin/ccache ${_hostspec}-${_bin}
|
||||
done
|
||||
done
|
||||
}
|
||||
@@ -0,0 +1,241 @@
|
||||
From b1d2df5090abc9202a7bf2d224ac90de22908d21 Mon Sep 17 00:00:00 2001
|
||||
From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Mon, 15 Jan 2018 11:27:24 +0000
|
||||
Subject: [PATCH 01/13] i386: Move struct ix86_frame to machine_function
|
||||
|
||||
Make ix86_frame available to i386 code generation. This is needed to
|
||||
backport the patch set of -mindirect-branch= to mitigate variant #2 of
|
||||
the speculative execution vulnerabilities on x86 processors identified
|
||||
by CVE-2017-5715, aka Spectre.
|
||||
|
||||
Backport from mainline
|
||||
2017-06-01 Bernd Edlinger <bernd.edlinger@hotmail.de>
|
||||
|
||||
* config/i386/i386.c (ix86_frame): Moved to ...
|
||||
* config/i386/i386.h (ix86_frame): Here.
|
||||
(machine_function): Add frame.
|
||||
* config/i386/i386.c (ix86_compute_frame_layout): Repace the
|
||||
frame argument with &cfun->machine->frame.
|
||||
(ix86_can_use_return_insn_p): Don't pass &frame to
|
||||
ix86_compute_frame_layout. Copy frame from cfun->machine->frame.
|
||||
(ix86_can_eliminate): Likewise.
|
||||
(ix86_expand_prologue): Likewise.
|
||||
(ix86_expand_epilogue): Likewise.
|
||||
(ix86_expand_split_stack_prologue): Likewise.
|
||||
---
|
||||
gcc/config/i386/i386.c | 68 ++++++++++----------------------------------------
|
||||
gcc/config/i386/i386.h | 53 ++++++++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 65 insertions(+), 56 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index 8b5faac5129..a1ff32b648b 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -2434,53 +2434,6 @@ struct GTY(()) stack_local_entry {
|
||||
struct stack_local_entry *next;
|
||||
};
|
||||
|
||||
-/* Structure describing stack frame layout.
|
||||
- Stack grows downward:
|
||||
-
|
||||
- [arguments]
|
||||
- <- ARG_POINTER
|
||||
- saved pc
|
||||
-
|
||||
- saved static chain if ix86_static_chain_on_stack
|
||||
-
|
||||
- saved frame pointer if frame_pointer_needed
|
||||
- <- HARD_FRAME_POINTER
|
||||
- [saved regs]
|
||||
- <- regs_save_offset
|
||||
- [padding0]
|
||||
-
|
||||
- [saved SSE regs]
|
||||
- <- sse_regs_save_offset
|
||||
- [padding1] |
|
||||
- | <- FRAME_POINTER
|
||||
- [va_arg registers] |
|
||||
- |
|
||||
- [frame] |
|
||||
- |
|
||||
- [padding2] | = to_allocate
|
||||
- <- STACK_POINTER
|
||||
- */
|
||||
-struct ix86_frame
|
||||
-{
|
||||
- int nsseregs;
|
||||
- int nregs;
|
||||
- int va_arg_size;
|
||||
- int red_zone_size;
|
||||
- int outgoing_arguments_size;
|
||||
-
|
||||
- /* The offsets relative to ARG_POINTER. */
|
||||
- HOST_WIDE_INT frame_pointer_offset;
|
||||
- HOST_WIDE_INT hard_frame_pointer_offset;
|
||||
- HOST_WIDE_INT stack_pointer_offset;
|
||||
- HOST_WIDE_INT hfp_save_offset;
|
||||
- HOST_WIDE_INT reg_save_offset;
|
||||
- HOST_WIDE_INT sse_reg_save_offset;
|
||||
-
|
||||
- /* When save_regs_using_mov is set, emit prologue using
|
||||
- move instead of push instructions. */
|
||||
- bool save_regs_using_mov;
|
||||
-};
|
||||
-
|
||||
/* Which cpu are we scheduling for. */
|
||||
enum attr_cpu ix86_schedule;
|
||||
|
||||
@@ -2572,7 +2525,7 @@ static unsigned int ix86_function_arg_boundary (machine_mode,
|
||||
const_tree);
|
||||
static rtx ix86_static_chain (const_tree, bool);
|
||||
static int ix86_function_regparm (const_tree, const_tree);
|
||||
-static void ix86_compute_frame_layout (struct ix86_frame *);
|
||||
+static void ix86_compute_frame_layout (void);
|
||||
static bool ix86_expand_vector_init_one_nonzero (bool, machine_mode,
|
||||
rtx, rtx, int);
|
||||
static void ix86_add_new_builtins (HOST_WIDE_INT);
|
||||
@@ -10944,7 +10897,8 @@ ix86_can_use_return_insn_p (void)
|
||||
if (crtl->args.pops_args && crtl->args.size >= 32768)
|
||||
return 0;
|
||||
|
||||
- ix86_compute_frame_layout (&frame);
|
||||
+ ix86_compute_frame_layout ();
|
||||
+ frame = cfun->machine->frame;
|
||||
return (frame.stack_pointer_offset == UNITS_PER_WORD
|
||||
&& (frame.nregs + frame.nsseregs) == 0);
|
||||
}
|
||||
@@ -11355,8 +11309,8 @@ ix86_can_eliminate (const int from, const int to)
|
||||
HOST_WIDE_INT
|
||||
ix86_initial_elimination_offset (int from, int to)
|
||||
{
|
||||
- struct ix86_frame frame;
|
||||
- ix86_compute_frame_layout (&frame);
|
||||
+ ix86_compute_frame_layout ();
|
||||
+ struct ix86_frame frame = cfun->machine->frame;
|
||||
|
||||
if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
|
||||
return frame.hard_frame_pointer_offset;
|
||||
@@ -11395,8 +11349,9 @@ ix86_builtin_setjmp_frame_value (void)
|
||||
/* Fill structure ix86_frame about frame of currently computed function. */
|
||||
|
||||
static void
|
||||
-ix86_compute_frame_layout (struct ix86_frame *frame)
|
||||
+ix86_compute_frame_layout (void)
|
||||
{
|
||||
+ struct ix86_frame *frame = &cfun->machine->frame;
|
||||
unsigned HOST_WIDE_INT stack_alignment_needed;
|
||||
HOST_WIDE_INT offset;
|
||||
unsigned HOST_WIDE_INT preferred_alignment;
|
||||
@@ -12702,7 +12657,8 @@ ix86_expand_prologue (void)
|
||||
m->fs.sp_offset = INCOMING_FRAME_SP_OFFSET;
|
||||
m->fs.sp_valid = true;
|
||||
|
||||
- ix86_compute_frame_layout (&frame);
|
||||
+ ix86_compute_frame_layout ();
|
||||
+ frame = m->frame;
|
||||
|
||||
if (!TARGET_64BIT && ix86_function_ms_hook_prologue (current_function_decl))
|
||||
{
|
||||
@@ -13379,7 +13335,8 @@ ix86_expand_epilogue (int style)
|
||||
bool using_drap;
|
||||
|
||||
ix86_finalize_stack_realign_flags ();
|
||||
- ix86_compute_frame_layout (&frame);
|
||||
+ ix86_compute_frame_layout ();
|
||||
+ frame = m->frame;
|
||||
|
||||
m->fs.sp_valid = (!frame_pointer_needed
|
||||
|| (crtl->sp_is_unchanging
|
||||
@@ -13876,7 +13833,8 @@ ix86_expand_split_stack_prologue (void)
|
||||
gcc_assert (flag_split_stack && reload_completed);
|
||||
|
||||
ix86_finalize_stack_realign_flags ();
|
||||
- ix86_compute_frame_layout (&frame);
|
||||
+ ix86_compute_frame_layout ();
|
||||
+ frame = cfun->machine->frame;
|
||||
allocate = frame.stack_pointer_offset - INCOMING_FRAME_SP_OFFSET;
|
||||
|
||||
/* This is the label we will branch to if we have enough stack
|
||||
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
|
||||
index 8113f83c7fd..54144166172 100644
|
||||
--- a/gcc/config/i386/i386.h
|
||||
+++ b/gcc/config/i386/i386.h
|
||||
@@ -2427,9 +2427,56 @@ enum avx_u128_state
|
||||
|
||||
#define FASTCALL_PREFIX '@'
|
||||
|
||||
+#ifndef USED_FOR_TARGET
|
||||
+/* Structure describing stack frame layout.
|
||||
+ Stack grows downward:
|
||||
+
|
||||
+ [arguments]
|
||||
+ <- ARG_POINTER
|
||||
+ saved pc
|
||||
+
|
||||
+ saved static chain if ix86_static_chain_on_stack
|
||||
+
|
||||
+ saved frame pointer if frame_pointer_needed
|
||||
+ <- HARD_FRAME_POINTER
|
||||
+ [saved regs]
|
||||
+ <- regs_save_offset
|
||||
+ [padding0]
|
||||
+
|
||||
+ [saved SSE regs]
|
||||
+ <- sse_regs_save_offset
|
||||
+ [padding1] |
|
||||
+ | <- FRAME_POINTER
|
||||
+ [va_arg registers] |
|
||||
+ |
|
||||
+ [frame] |
|
||||
+ |
|
||||
+ [padding2] | = to_allocate
|
||||
+ <- STACK_POINTER
|
||||
+ */
|
||||
+struct GTY(()) ix86_frame
|
||||
+{
|
||||
+ int nsseregs;
|
||||
+ int nregs;
|
||||
+ int va_arg_size;
|
||||
+ int red_zone_size;
|
||||
+ int outgoing_arguments_size;
|
||||
+
|
||||
+ /* The offsets relative to ARG_POINTER. */
|
||||
+ HOST_WIDE_INT frame_pointer_offset;
|
||||
+ HOST_WIDE_INT hard_frame_pointer_offset;
|
||||
+ HOST_WIDE_INT stack_pointer_offset;
|
||||
+ HOST_WIDE_INT hfp_save_offset;
|
||||
+ HOST_WIDE_INT reg_save_offset;
|
||||
+ HOST_WIDE_INT sse_reg_save_offset;
|
||||
+
|
||||
+ /* When save_regs_using_mov is set, emit prologue using
|
||||
+ move instead of push instructions. */
|
||||
+ bool save_regs_using_mov;
|
||||
+};
|
||||
+
|
||||
/* Machine specific frame tracking during prologue/epilogue generation. */
|
||||
|
||||
-#ifndef USED_FOR_TARGET
|
||||
struct GTY(()) machine_frame_state
|
||||
{
|
||||
/* This pair tracks the currently active CFA as reg+offset. When reg
|
||||
@@ -2475,6 +2522,9 @@ struct GTY(()) machine_function {
|
||||
int varargs_fpr_size;
|
||||
int optimize_mode_switching[MAX_386_ENTITIES];
|
||||
|
||||
+ /* Cached initial frame layout for the current function. */
|
||||
+ struct ix86_frame frame;
|
||||
+
|
||||
/* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE
|
||||
has been computed for. */
|
||||
int use_fast_prologue_epilogue_nregs;
|
||||
@@ -2554,6 +2604,7 @@ struct GTY(()) machine_function {
|
||||
#define ix86_current_function_calls_tls_descriptor \
|
||||
(ix86_tls_descriptor_calls_expanded_in_cfun && df_regs_ever_live_p (SP_REG))
|
||||
#define ix86_static_chain_on_stack (cfun->machine->static_chain_on_stack)
|
||||
+#define ix86_red_zone_size (cfun->machine->frame.red_zone_size)
|
||||
|
||||
/* Control behavior of x86_file_start. */
|
||||
#define X86_FILE_START_VERSION_DIRECTIVE false
|
||||
--
|
||||
2.16.3
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
From b1fc91cda7c15264116f3dde6944ead149123653 Mon Sep 17 00:00:00 2001
|
||||
From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Mon, 15 Jan 2018 11:28:44 +0000
|
||||
Subject: [PATCH 02/13] i386: Use reference of struct ix86_frame to avoid copy
|
||||
|
||||
When there is no need to make a copy of ix86_frame, we can use reference
|
||||
of struct ix86_frame to avoid copy.
|
||||
|
||||
Backport from mainline
|
||||
2017-11-06 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* config/i386/i386.c (ix86_can_use_return_insn_p): Use reference
|
||||
of struct ix86_frame.
|
||||
(ix86_initial_elimination_offset): Likewise.
|
||||
(ix86_expand_split_stack_prologue): Likewise.
|
||||
---
|
||||
gcc/config/i386/i386.c | 8 +++-----
|
||||
1 file changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index a1ff32b648b..13ebf107e90 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -10887,7 +10887,6 @@ symbolic_reference_mentioned_p (rtx op)
|
||||
bool
|
||||
ix86_can_use_return_insn_p (void)
|
||||
{
|
||||
- struct ix86_frame frame;
|
||||
|
||||
if (! reload_completed || frame_pointer_needed)
|
||||
return 0;
|
||||
@@ -10898,7 +10897,7 @@ ix86_can_use_return_insn_p (void)
|
||||
return 0;
|
||||
|
||||
ix86_compute_frame_layout ();
|
||||
- frame = cfun->machine->frame;
|
||||
+ struct ix86_frame &frame = cfun->machine->frame;
|
||||
return (frame.stack_pointer_offset == UNITS_PER_WORD
|
||||
&& (frame.nregs + frame.nsseregs) == 0);
|
||||
}
|
||||
@@ -11310,7 +11309,7 @@ HOST_WIDE_INT
|
||||
ix86_initial_elimination_offset (int from, int to)
|
||||
{
|
||||
ix86_compute_frame_layout ();
|
||||
- struct ix86_frame frame = cfun->machine->frame;
|
||||
+ struct ix86_frame &frame = cfun->machine->frame;
|
||||
|
||||
if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
|
||||
return frame.hard_frame_pointer_offset;
|
||||
@@ -13821,7 +13820,6 @@ static GTY(()) rtx split_stack_fn_large;
|
||||
void
|
||||
ix86_expand_split_stack_prologue (void)
|
||||
{
|
||||
- struct ix86_frame frame;
|
||||
HOST_WIDE_INT allocate;
|
||||
unsigned HOST_WIDE_INT args_size;
|
||||
rtx_code_label *label;
|
||||
@@ -13834,7 +13832,7 @@ ix86_expand_split_stack_prologue (void)
|
||||
|
||||
ix86_finalize_stack_realign_flags ();
|
||||
ix86_compute_frame_layout ();
|
||||
- frame = cfun->machine->frame;
|
||||
+ struct ix86_frame &frame = cfun->machine->frame;
|
||||
allocate = frame.stack_pointer_offset - INCOMING_FRAME_SP_OFFSET;
|
||||
|
||||
/* This is the label we will branch to if we have enough stack
|
||||
--
|
||||
2.16.3
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
From 3e39c0a8053b3e960cf4c3aea3c814e7dc97cfd6 Mon Sep 17 00:00:00 2001
|
||||
From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Sat, 27 Jan 2018 13:10:24 +0000
|
||||
Subject: [PATCH 03/13] i386: Use const reference of struct ix86_frame to avoid
|
||||
copy
|
||||
|
||||
We can use const reference of struct ix86_frame to avoid making a local
|
||||
copy of ix86_frame. ix86_expand_epilogue makes a local copy of struct
|
||||
ix86_frame and uses the reg_save_offset field as a local variable. This
|
||||
patch uses a separate local variable for reg_save_offset.
|
||||
|
||||
Tested on x86-64 with ada.
|
||||
|
||||
Backport from mainline
|
||||
PR target/83905
|
||||
* config/i386/i386.c (ix86_expand_prologue): Use cost reference
|
||||
of struct ix86_frame.
|
||||
(ix86_expand_epilogue): Likewise. Add a local variable for
|
||||
the reg_save_offset field in struct ix86_frame.
|
||||
|
||||
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@257123 138bc75d-0d04-0410-961f-82ee72b054a4
|
||||
---
|
||||
gcc/config/i386/i386.c | 24 ++++++++++++------------
|
||||
1 file changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index 13ebf107e90..6c98f7581e2 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -12633,7 +12633,6 @@ ix86_expand_prologue (void)
|
||||
{
|
||||
struct machine_function *m = cfun->machine;
|
||||
rtx insn, t;
|
||||
- struct ix86_frame frame;
|
||||
HOST_WIDE_INT allocate;
|
||||
bool int_registers_saved;
|
||||
bool sse_registers_saved;
|
||||
@@ -12657,7 +12656,7 @@ ix86_expand_prologue (void)
|
||||
m->fs.sp_valid = true;
|
||||
|
||||
ix86_compute_frame_layout ();
|
||||
- frame = m->frame;
|
||||
+ const struct ix86_frame &frame = cfun->machine->frame;
|
||||
|
||||
if (!TARGET_64BIT && ix86_function_ms_hook_prologue (current_function_decl))
|
||||
{
|
||||
@@ -13329,13 +13328,12 @@ ix86_expand_epilogue (int style)
|
||||
{
|
||||
struct machine_function *m = cfun->machine;
|
||||
struct machine_frame_state frame_state_save = m->fs;
|
||||
- struct ix86_frame frame;
|
||||
bool restore_regs_via_mov;
|
||||
bool using_drap;
|
||||
|
||||
ix86_finalize_stack_realign_flags ();
|
||||
ix86_compute_frame_layout ();
|
||||
- frame = m->frame;
|
||||
+ const struct ix86_frame &frame = cfun->machine->frame;
|
||||
|
||||
m->fs.sp_valid = (!frame_pointer_needed
|
||||
|| (crtl->sp_is_unchanging
|
||||
@@ -13377,11 +13375,13 @@ ix86_expand_epilogue (int style)
|
||||
+ UNITS_PER_WORD);
|
||||
}
|
||||
|
||||
+ HOST_WIDE_INT reg_save_offset = frame.reg_save_offset;
|
||||
+
|
||||
/* Special care must be taken for the normal return case of a function
|
||||
using eh_return: the eax and edx registers are marked as saved, but
|
||||
not restored along this path. Adjust the save location to match. */
|
||||
if (crtl->calls_eh_return && style != 2)
|
||||
- frame.reg_save_offset -= 2 * UNITS_PER_WORD;
|
||||
+ reg_save_offset -= 2 * UNITS_PER_WORD;
|
||||
|
||||
/* EH_RETURN requires the use of moves to function properly. */
|
||||
if (crtl->calls_eh_return)
|
||||
@@ -13397,11 +13397,11 @@ ix86_expand_epilogue (int style)
|
||||
else if (TARGET_EPILOGUE_USING_MOVE
|
||||
&& cfun->machine->use_fast_prologue_epilogue
|
||||
&& (frame.nregs > 1
|
||||
- || m->fs.sp_offset != frame.reg_save_offset))
|
||||
+ || m->fs.sp_offset != reg_save_offset))
|
||||
restore_regs_via_mov = true;
|
||||
else if (frame_pointer_needed
|
||||
&& !frame.nregs
|
||||
- && m->fs.sp_offset != frame.reg_save_offset)
|
||||
+ && m->fs.sp_offset != reg_save_offset)
|
||||
restore_regs_via_mov = true;
|
||||
else if (frame_pointer_needed
|
||||
&& TARGET_USE_LEAVE
|
||||
@@ -13439,7 +13439,7 @@ ix86_expand_epilogue (int style)
|
||||
rtx t;
|
||||
|
||||
if (frame.nregs)
|
||||
- ix86_emit_restore_regs_using_mov (frame.reg_save_offset, style == 2);
|
||||
+ ix86_emit_restore_regs_using_mov (reg_save_offset, style == 2);
|
||||
|
||||
/* eh_return epilogues need %ecx added to the stack pointer. */
|
||||
if (style == 2)
|
||||
@@ -13529,19 +13529,19 @@ ix86_expand_epilogue (int style)
|
||||
epilogues. */
|
||||
if (!m->fs.sp_valid
|
||||
|| (TARGET_SEH
|
||||
- && (m->fs.sp_offset - frame.reg_save_offset
|
||||
+ && (m->fs.sp_offset - reg_save_offset
|
||||
>= SEH_MAX_FRAME_SIZE)))
|
||||
{
|
||||
pro_epilogue_adjust_stack (stack_pointer_rtx, hard_frame_pointer_rtx,
|
||||
GEN_INT (m->fs.fp_offset
|
||||
- - frame.reg_save_offset),
|
||||
+ - reg_save_offset),
|
||||
style, false);
|
||||
}
|
||||
- else if (m->fs.sp_offset != frame.reg_save_offset)
|
||||
+ else if (m->fs.sp_offset != reg_save_offset)
|
||||
{
|
||||
pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx,
|
||||
GEN_INT (m->fs.sp_offset
|
||||
- - frame.reg_save_offset),
|
||||
+ - reg_save_offset),
|
||||
style,
|
||||
m->fs.cfa_reg == stack_pointer_rtx);
|
||||
}
|
||||
--
|
||||
2.16.3
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,941 @@
|
||||
From 61bb7f0e152ce5be700a44007d036ea0de4b254d Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Sat, 6 Jan 2018 22:29:56 -0800
|
||||
Subject: [PATCH 06/13] x86: Add -mindirect-branch-register
|
||||
|
||||
Add -mindirect-branch-register to force indirect branch via register.
|
||||
This is implemented by disabling patterns of indirect branch via memory,
|
||||
similar to TARGET_X32.
|
||||
|
||||
-mindirect-branch= and -mfunction-return= tests are updated with
|
||||
-mno-indirect-branch-register to avoid false test failures when
|
||||
-mindirect-branch-register is added to RUNTESTFLAGS for "make check".
|
||||
|
||||
gcc/
|
||||
|
||||
Backport from mainline
|
||||
2018-01-14 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* config/i386/constraints.md (Bs): Disallow memory operand for
|
||||
-mindirect-branch-register.
|
||||
(Bw): Likewise.
|
||||
* config/i386/predicates.md (indirect_branch_operand): Likewise.
|
||||
(GOT_memory_operand): Likewise.
|
||||
(call_insn_operand): Likewise.
|
||||
(sibcall_insn_operand): Likewise.
|
||||
(GOT32_symbol_operand): Likewise.
|
||||
* config/i386/i386.md (indirect_jump): Call convert_memory_address
|
||||
for -mindirect-branch-register.
|
||||
(tablejump): Likewise.
|
||||
(*sibcall_memory): Likewise.
|
||||
(*sibcall_value_memory): Likewise.
|
||||
Disallow peepholes of indirect call and jump via memory for
|
||||
-mindirect-branch-register.
|
||||
(*call_pop): Replace m with Bw.
|
||||
(*call_value_pop): Likewise.
|
||||
(*sibcall_pop_memory): Replace m with Bs.
|
||||
* config/i386/i386.opt (mindirect-branch-register): New option.
|
||||
* doc/invoke.texi: Document -mindirect-branch-register option.
|
||||
|
||||
gcc/testsuite/
|
||||
|
||||
Backport from mainline
|
||||
2018-01-14 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* gcc.target/i386/indirect-thunk-1.c (dg-options): Add
|
||||
-mno-indirect-branch-register.
|
||||
* gcc.target/i386/indirect-thunk-2.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-3.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-4.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-5.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-6.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-7.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-attr-7.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-bnd-1.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-bnd-2.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-bnd-3.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-bnd-4.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-extern-5.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-extern-6.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-extern-7.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-inline-5.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-inline-6.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-inline-7.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-10.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-11.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-12.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-13.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-14.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-15.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-9.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-register-1.c: New test.
|
||||
* gcc.target/i386/indirect-thunk-register-2.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-register-3.c: Likewise.
|
||||
|
||||
i386: Rename to ix86_indirect_branch_register
|
||||
|
||||
Rename the variable for -mindirect-branch-register to
|
||||
ix86_indirect_branch_register to match the command-line option name.
|
||||
|
||||
Backport from mainline
|
||||
2018-01-15 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* config/i386/constraints.md (Bs): Replace
|
||||
ix86_indirect_branch_thunk_register with
|
||||
ix86_indirect_branch_register.
|
||||
(Bw): Likewise.
|
||||
* config/i386/i386.md (indirect_jump): Likewise.
|
||||
(tablejump): Likewise.
|
||||
(*sibcall_memory): Likewise.
|
||||
(*sibcall_value_memory): Likewise.
|
||||
Peepholes of indirect call and jump via memory: Likewise.
|
||||
* config/i386/i386.opt: Likewise.
|
||||
* config/i386/predicates.md (indirect_branch_operand): Likewise.
|
||||
(GOT_memory_operand): Likewise.
|
||||
(call_insn_operand): Likewise.
|
||||
(sibcall_insn_operand): Likewise.
|
||||
(GOT32_symbol_operand): Likewise.
|
||||
|
||||
x86: Rewrite ix86_indirect_branch_register logic
|
||||
|
||||
Rewrite ix86_indirect_branch_register logic with
|
||||
|
||||
(and (not (match_test "ix86_indirect_branch_register"))
|
||||
(original condition before r256662))
|
||||
|
||||
Backport from mainline
|
||||
2018-01-15 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* config/i386/predicates.md (constant_call_address_operand):
|
||||
Rewrite ix86_indirect_branch_register logic.
|
||||
(sibcall_insn_operand): Likewise.
|
||||
|
||||
Don't check ix86_indirect_branch_register for GOT operand
|
||||
|
||||
Since GOT_memory_operand and GOT32_symbol_operand are simple pattern
|
||||
matches, don't check ix86_indirect_branch_register here. If needed,
|
||||
-mindirect-branch= will convert indirect branch via GOT slot to a call
|
||||
and return thunk.
|
||||
|
||||
Backport from mainline
|
||||
2018-01-15 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* config/i386/constraints.md (Bs): Update
|
||||
ix86_indirect_branch_register check. Don't check
|
||||
ix86_indirect_branch_register with GOT_memory_operand.
|
||||
(Bw): Likewise.
|
||||
* config/i386/predicates.md (GOT_memory_operand): Don't check
|
||||
ix86_indirect_branch_register here.
|
||||
(GOT32_symbol_operand): Likewise.
|
||||
|
||||
i386: Rewrite indirect_branch_operand logic
|
||||
|
||||
Backport from mainline
|
||||
2018-01-15 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* config/i386/predicates.md (indirect_branch_operand): Rewrite
|
||||
ix86_indirect_branch_register logic.
|
||||
---
|
||||
gcc/config/i386/constraints.md | 6 ++--
|
||||
gcc/config/i386/i386.md | 34 ++++++++++++++--------
|
||||
gcc/config/i386/i386.opt | 4 +++
|
||||
gcc/config/i386/predicates.md | 21 +++++++------
|
||||
gcc/doc/invoke.texi | 6 +++-
|
||||
gcc/testsuite/gcc.target/i386/indirect-thunk-1.c | 2 +-
|
||||
gcc/testsuite/gcc.target/i386/indirect-thunk-2.c | 2 +-
|
||||
gcc/testsuite/gcc.target/i386/indirect-thunk-3.c | 2 +-
|
||||
gcc/testsuite/gcc.target/i386/indirect-thunk-4.c | 2 +-
|
||||
gcc/testsuite/gcc.target/i386/indirect-thunk-5.c | 2 +-
|
||||
gcc/testsuite/gcc.target/i386/indirect-thunk-6.c | 2 +-
|
||||
gcc/testsuite/gcc.target/i386/indirect-thunk-7.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-attr-1.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-attr-2.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-attr-3.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-attr-4.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-attr-5.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-attr-6.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-attr-7.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-bnd-1.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-bnd-2.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-bnd-3.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-bnd-4.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-extern-1.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-extern-2.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-extern-3.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-extern-4.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-extern-5.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-extern-6.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-extern-7.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-inline-1.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-inline-2.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-inline-3.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-inline-4.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-inline-5.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-inline-6.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-inline-7.c | 2 +-
|
||||
.../gcc.target/i386/indirect-thunk-register-1.c | 22 ++++++++++++++
|
||||
.../gcc.target/i386/indirect-thunk-register-2.c | 20 +++++++++++++
|
||||
.../gcc.target/i386/indirect-thunk-register-3.c | 19 ++++++++++++
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-10.c | 2 +-
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-11.c | 2 +-
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-12.c | 2 +-
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-13.c | 2 +-
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-14.c | 2 +-
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-15.c | 2 +-
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-9.c | 2 +-
|
||||
47 files changed, 147 insertions(+), 63 deletions(-)
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/indirect-thunk-register-1.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/indirect-thunk-register-2.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/indirect-thunk-register-3.c
|
||||
|
||||
diff --git a/gcc/config/i386/constraints.md b/gcc/config/i386/constraints.md
|
||||
index 1a4c701ad13..9204c8e8487 100644
|
||||
--- a/gcc/config/i386/constraints.md
|
||||
+++ b/gcc/config/i386/constraints.md
|
||||
@@ -172,14 +172,16 @@
|
||||
|
||||
(define_constraint "Bs"
|
||||
"@internal Sibcall memory operand."
|
||||
- (ior (and (not (match_test "TARGET_X32"))
|
||||
+ (ior (and (not (match_test "ix86_indirect_branch_register"))
|
||||
+ (not (match_test "TARGET_X32"))
|
||||
(match_operand 0 "sibcall_memory_operand"))
|
||||
(and (match_test "TARGET_X32 && Pmode == DImode")
|
||||
(match_operand 0 "GOT_memory_operand"))))
|
||||
|
||||
(define_constraint "Bw"
|
||||
"@internal Call memory operand."
|
||||
- (ior (and (not (match_test "TARGET_X32"))
|
||||
+ (ior (and (not (match_test "ix86_indirect_branch_register"))
|
||||
+ (not (match_test "TARGET_X32"))
|
||||
(match_operand 0 "memory_operand"))
|
||||
(and (match_test "TARGET_X32 && Pmode == DImode")
|
||||
(match_operand 0 "GOT_memory_operand"))))
|
||||
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
|
||||
index 2da671e9f2d..05a88fff356 100644
|
||||
--- a/gcc/config/i386/i386.md
|
||||
+++ b/gcc/config/i386/i386.md
|
||||
@@ -11805,7 +11805,7 @@
|
||||
[(set (pc) (match_operand 0 "indirect_branch_operand"))]
|
||||
""
|
||||
{
|
||||
- if (TARGET_X32)
|
||||
+ if (TARGET_X32 || ix86_indirect_branch_register)
|
||||
operands[0] = convert_memory_address (word_mode, operands[0]);
|
||||
cfun->machine->has_local_indirect_jump = true;
|
||||
})
|
||||
@@ -11859,7 +11859,7 @@
|
||||
OPTAB_DIRECT);
|
||||
}
|
||||
|
||||
- if (TARGET_X32)
|
||||
+ if (TARGET_X32 || ix86_indirect_branch_register)
|
||||
operands[0] = convert_memory_address (word_mode, operands[0]);
|
||||
cfun->machine->has_local_indirect_jump = true;
|
||||
})
|
||||
@@ -12048,7 +12048,7 @@
|
||||
[(call (mem:QI (match_operand:W 0 "memory_operand" "m"))
|
||||
(match_operand 1))
|
||||
(unspec [(const_int 0)] UNSPEC_PEEPSIB)]
|
||||
- "!TARGET_X32"
|
||||
+ "!TARGET_X32 && !ix86_indirect_branch_register"
|
||||
"* return ix86_output_call_insn (insn, operands[0]);"
|
||||
[(set_attr "type" "call")])
|
||||
|
||||
@@ -12057,7 +12057,9 @@
|
||||
(match_operand:W 1 "memory_operand"))
|
||||
(call (mem:QI (match_dup 0))
|
||||
(match_operand 3))]
|
||||
- "!TARGET_X32 && SIBLING_CALL_P (peep2_next_insn (1))
|
||||
+ "!TARGET_X32
|
||||
+ && !ix86_indirect_branch_register
|
||||
+ && SIBLING_CALL_P (peep2_next_insn (1))
|
||||
&& !reg_mentioned_p (operands[0],
|
||||
CALL_INSN_FUNCTION_USAGE (peep2_next_insn (1)))"
|
||||
[(parallel [(call (mem:QI (match_dup 1))
|
||||
@@ -12070,7 +12072,9 @@
|
||||
(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)
|
||||
(call (mem:QI (match_dup 0))
|
||||
(match_operand 3))]
|
||||
- "!TARGET_X32 && SIBLING_CALL_P (peep2_next_insn (2))
|
||||
+ "!TARGET_X32
|
||||
+ && !ix86_indirect_branch_register
|
||||
+ && SIBLING_CALL_P (peep2_next_insn (2))
|
||||
&& !reg_mentioned_p (operands[0],
|
||||
CALL_INSN_FUNCTION_USAGE (peep2_next_insn (2)))"
|
||||
[(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)
|
||||
@@ -12092,7 +12096,7 @@
|
||||
})
|
||||
|
||||
(define_insn "*call_pop"
|
||||
- [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lmBz"))
|
||||
+ [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lBwBz"))
|
||||
(match_operand 1))
|
||||
(set (reg:SI SP_REG)
|
||||
(plus:SI (reg:SI SP_REG)
|
||||
@@ -12112,7 +12116,7 @@
|
||||
[(set_attr "type" "call")])
|
||||
|
||||
(define_insn "*sibcall_pop_memory"
|
||||
- [(call (mem:QI (match_operand:SI 0 "memory_operand" "m"))
|
||||
+ [(call (mem:QI (match_operand:SI 0 "memory_operand" "Bs"))
|
||||
(match_operand 1))
|
||||
(set (reg:SI SP_REG)
|
||||
(plus:SI (reg:SI SP_REG)
|
||||
@@ -12166,7 +12170,9 @@
|
||||
[(set (match_operand:W 0 "register_operand")
|
||||
(match_operand:W 1 "memory_operand"))
|
||||
(set (pc) (match_dup 0))]
|
||||
- "!TARGET_X32 && peep2_reg_dead_p (2, operands[0])"
|
||||
+ "!TARGET_X32
|
||||
+ && !ix86_indirect_branch_register
|
||||
+ && peep2_reg_dead_p (2, operands[0])"
|
||||
[(set (pc) (match_dup 1))])
|
||||
|
||||
;; Call subroutine, returning value in operand 0
|
||||
@@ -12244,7 +12250,7 @@
|
||||
(call (mem:QI (match_operand:W 1 "memory_operand" "m"))
|
||||
(match_operand 2)))
|
||||
(unspec [(const_int 0)] UNSPEC_PEEPSIB)]
|
||||
- "!TARGET_X32"
|
||||
+ "!TARGET_X32 && !ix86_indirect_branch_register"
|
||||
"* return ix86_output_call_insn (insn, operands[1]);"
|
||||
[(set_attr "type" "callv")])
|
||||
|
||||
@@ -12254,7 +12260,9 @@
|
||||
(set (match_operand 2)
|
||||
(call (mem:QI (match_dup 0))
|
||||
(match_operand 3)))]
|
||||
- "!TARGET_X32 && SIBLING_CALL_P (peep2_next_insn (1))
|
||||
+ "!TARGET_X32
|
||||
+ && !ix86_indirect_branch_register
|
||||
+ && SIBLING_CALL_P (peep2_next_insn (1))
|
||||
&& !reg_mentioned_p (operands[0],
|
||||
CALL_INSN_FUNCTION_USAGE (peep2_next_insn (1)))"
|
||||
[(parallel [(set (match_dup 2)
|
||||
@@ -12269,7 +12277,9 @@
|
||||
(set (match_operand 2)
|
||||
(call (mem:QI (match_dup 0))
|
||||
(match_operand 3)))]
|
||||
- "!TARGET_X32 && SIBLING_CALL_P (peep2_next_insn (2))
|
||||
+ "!TARGET_X32
|
||||
+ && !ix86_indirect_branch_register
|
||||
+ && SIBLING_CALL_P (peep2_next_insn (2))
|
||||
&& !reg_mentioned_p (operands[0],
|
||||
CALL_INSN_FUNCTION_USAGE (peep2_next_insn (2)))"
|
||||
[(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)
|
||||
@@ -12294,7 +12304,7 @@
|
||||
|
||||
(define_insn "*call_value_pop"
|
||||
[(set (match_operand 0)
|
||||
- (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lmBz"))
|
||||
+ (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lBwBz"))
|
||||
(match_operand 2)))
|
||||
(set (reg:SI SP_REG)
|
||||
(plus:SI (reg:SI SP_REG)
|
||||
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
|
||||
index ad5916fb643..a97f84f68f2 100644
|
||||
--- a/gcc/config/i386/i386.opt
|
||||
+++ b/gcc/config/i386/i386.opt
|
||||
@@ -921,3 +921,7 @@ Enum(indirect_branch) String(thunk-inline) Value(indirect_branch_thunk_inline)
|
||||
|
||||
EnumValue
|
||||
Enum(indirect_branch) String(thunk-extern) Value(indirect_branch_thunk_extern)
|
||||
+
|
||||
+mindirect-branch-register
|
||||
+Target Report Var(ix86_indirect_branch_register) Init(0)
|
||||
+Force indirect call and jump via register.
|
||||
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
|
||||
index 93dda7bb0e7..d1f0a7dbf61 100644
|
||||
--- a/gcc/config/i386/predicates.md
|
||||
+++ b/gcc/config/i386/predicates.md
|
||||
@@ -593,7 +593,8 @@
|
||||
;; Test for a valid operand for indirect branch.
|
||||
(define_predicate "indirect_branch_operand"
|
||||
(ior (match_operand 0 "register_operand")
|
||||
- (and (not (match_test "TARGET_X32"))
|
||||
+ (and (not (match_test "ix86_indirect_branch_register"))
|
||||
+ (not (match_test "TARGET_X32"))
|
||||
(match_operand 0 "memory_operand"))))
|
||||
|
||||
;; Return true if OP is a memory operands that can be used in sibcalls.
|
||||
@@ -636,20 +637,22 @@
|
||||
(ior (match_test "constant_call_address_operand
|
||||
(op, mode == VOIDmode ? mode : Pmode)")
|
||||
(match_operand 0 "call_register_no_elim_operand")
|
||||
- (ior (and (not (match_test "TARGET_X32"))
|
||||
- (match_operand 0 "memory_operand"))
|
||||
- (and (match_test "TARGET_X32 && Pmode == DImode")
|
||||
- (match_operand 0 "GOT_memory_operand")))))
|
||||
+ (and (not (match_test "ix86_indirect_branch_register"))
|
||||
+ (ior (and (not (match_test "TARGET_X32"))
|
||||
+ (match_operand 0 "memory_operand"))
|
||||
+ (and (match_test "TARGET_X32 && Pmode == DImode")
|
||||
+ (match_operand 0 "GOT_memory_operand"))))))
|
||||
|
||||
;; Similarly, but for tail calls, in which we cannot allow memory references.
|
||||
(define_special_predicate "sibcall_insn_operand"
|
||||
(ior (match_test "constant_call_address_operand
|
||||
(op, mode == VOIDmode ? mode : Pmode)")
|
||||
(match_operand 0 "register_no_elim_operand")
|
||||
- (ior (and (not (match_test "TARGET_X32"))
|
||||
- (match_operand 0 "sibcall_memory_operand"))
|
||||
- (and (match_test "TARGET_X32 && Pmode == DImode")
|
||||
- (match_operand 0 "GOT_memory_operand")))))
|
||||
+ (and (not (match_test "ix86_indirect_branch_register"))
|
||||
+ (ior (and (not (match_test "TARGET_X32"))
|
||||
+ (match_operand 0 "sibcall_memory_operand"))
|
||||
+ (and (match_test "TARGET_X32 && Pmode == DImode")
|
||||
+ (match_operand 0 "GOT_memory_operand"))))))
|
||||
|
||||
;; Return true if OP is a 32-bit GOT symbol operand.
|
||||
(define_predicate "GOT32_symbol_operand"
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index 337a761015a..94374661f2d 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -1170,7 +1170,7 @@ See RS/6000 and PowerPC Options.
|
||||
-mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
|
||||
-malign-data=@var{type} -mstack-protector-guard=@var{guard} @gol
|
||||
-mmitigate-rop -mindirect-branch=@var{choice} @gol
|
||||
--mfunction-return=@var{choice}}
|
||||
+-mfunction-return=@var{choice} -mindirect-branch-register}
|
||||
|
||||
@emph{x86 Windows Options}
|
||||
@gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
|
||||
@@ -24253,6 +24253,10 @@ object file. You can control this behavior for a specific function by
|
||||
using the function attribute @code{function_return}.
|
||||
@xref{Function Attributes}.
|
||||
|
||||
+@item -mindirect-branch-register
|
||||
+@opindex -mindirect-branch-register
|
||||
+Force indirect call and jump via register.
|
||||
+
|
||||
@end table
|
||||
|
||||
These @samp{-m} switches are supported in addition to the above
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c
|
||||
index e365ef5698a..60d09881a99 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c
|
||||
index 05a51ad9157..aac75163794 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c
|
||||
index 3c0d4c39f0b..9e24a385387 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c
|
||||
index 14d4ef6dd98..127b5d94523 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-5.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-5.c
|
||||
index b4836c38d6c..fcaa18d10b7 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-5.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-5.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile { target *-*-linux* } } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk" } */
|
||||
|
||||
extern void bar (void);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-6.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-6.c
|
||||
index 1f06bd1af74..e4649283d10 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-6.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-6.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile { target *-*-linux* } } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk" } */
|
||||
|
||||
extern void bar (void);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c
|
||||
index bc6b47a636e..17c2d0faf88 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
|
||||
|
||||
void func0 (void);
|
||||
void func1 (void);
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c
|
||||
index 2257be3affa..9194ccf3cbc 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c
|
||||
index e9cfdc5879e..e51f261a612 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c
|
||||
index f938db050f7..4aeec1833cd 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c
|
||||
index 4e58599692a..ac0e5999f63 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c
|
||||
index b8d50249d8b..573cf1ef09e 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c
|
||||
index 455adabfe0e..b2b37fc6e2e 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c
|
||||
index 4595b841ec0..4a43e199931 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */
|
||||
|
||||
void func0 (void);
|
||||
void func1 (void);
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-1.c
|
||||
index 5e3e118e9bd..ac84ab623fa 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-1.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-1.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile { target { ! x32 } } } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fno-pic" } */
|
||||
|
||||
void (*dispatch) (char *);
|
||||
char buf[10];
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-2.c
|
||||
index 2801aa4192e..ce655e8be1c 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-2.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-2.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile { target { ! x32 } } } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fno-pic" } */
|
||||
|
||||
void (*dispatch) (char *);
|
||||
char buf[10];
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-3.c
|
||||
index 70b4fb36eea..d34485a0010 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-3.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-3.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile { target { *-*-linux* && { ! x32 } } } } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fpic -fno-plt" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fpic -fno-plt" } */
|
||||
|
||||
void bar (char *);
|
||||
char buf[10];
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-4.c
|
||||
index 3baf03ee77c..0e19830de4d 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-4.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-bnd-4.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile { target { *-*-linux* && { ! x32 } } } } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fpic -fno-plt" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fcheck-pointer-bounds -mmpx -fpic -fno-plt" } */
|
||||
|
||||
void bar (char *);
|
||||
char buf[10];
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c
|
||||
index edeb264218c..579441f250e 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c
|
||||
index 1d00413a76a..c92e6f2b02d 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c
|
||||
index 06ebf1c9063..d9964c25bbd 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c
|
||||
index 1c8f9446636..d4dca4dc5fe 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-5.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-5.c
|
||||
index 21740ac5b7f..5c07e02df6a 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-5.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-5.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile { target *-*-linux* } } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-extern" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-extern" } */
|
||||
|
||||
extern void bar (void);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-6.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-6.c
|
||||
index a77c1f470b8..3eb440693a0 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-6.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-6.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile { target *-*-linux* } } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-extern" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-extern" } */
|
||||
|
||||
extern void bar (void);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c
|
||||
index 86e9fd1f1e4..aece9383697 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
|
||||
|
||||
void func0 (void);
|
||||
void func1 (void);
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c
|
||||
index 3ecde878867..3aba5e8c81f 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c
|
||||
index df32a19a2b5..0f0181d6672 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c
|
||||
index 9540996de01..2eef6f35a75 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c
|
||||
index f3db6e2441f..e825a10f14c 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
|
||||
|
||||
typedef void (*dispatch_t)(long offset);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-5.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-5.c
|
||||
index 0f687c3b027..c6d77e10352 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-5.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-5.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile { target *-*-linux* } } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-inline" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-inline" } */
|
||||
|
||||
extern void bar (void);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-6.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-6.c
|
||||
index b27c6fc96a2..6454827b780 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-6.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-6.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile { target *-*-linux* } } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-inline" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fpic -fno-plt -mindirect-branch=thunk-inline" } */
|
||||
|
||||
extern void bar (void);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c
|
||||
index 764a375fc37..c67066cf197 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
|
||||
|
||||
void func0 (void);
|
||||
void func1 (void);
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-1.c
|
||||
new file mode 100644
|
||||
index 00000000000..7d396a31953
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-1.c
|
||||
@@ -0,0 +1,22 @@
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2 -mindirect-branch=thunk -mindirect-branch-register -fno-pic" } */
|
||||
+
|
||||
+typedef void (*dispatch_t)(long offset);
|
||||
+
|
||||
+dispatch_t dispatch;
|
||||
+
|
||||
+void
|
||||
+male_indirect_jump (long offset)
|
||||
+{
|
||||
+ dispatch(offset);
|
||||
+}
|
||||
+
|
||||
+/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */
|
||||
+/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */
|
||||
+/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */
|
||||
+/* { dg-final { scan-assembler "mov\[ \t\](%eax|%rax), \\((%esp|%rsp)\\)" } } */
|
||||
+/* { dg-final { scan-assembler {\tpause} } } */
|
||||
+/* { dg-final { scan-assembler-not "push(?:l|q)\[ \t\]*_?dispatch" } } */
|
||||
+/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */
|
||||
+/* { dg-final { scan-assembler-not "__x86_indirect_thunk\n" } } */
|
||||
+/* { dg-final { scan-assembler-not "__x86_indirect_thunk_bnd\n" } } */
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-2.c
|
||||
new file mode 100644
|
||||
index 00000000000..e7e616bb271
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-2.c
|
||||
@@ -0,0 +1,20 @@
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2 -mindirect-branch=thunk-inline -mindirect-branch-register -fno-pic" } */
|
||||
+
|
||||
+typedef void (*dispatch_t)(long offset);
|
||||
+
|
||||
+dispatch_t dispatch;
|
||||
+
|
||||
+void
|
||||
+male_indirect_jump (long offset)
|
||||
+{
|
||||
+ dispatch(offset);
|
||||
+}
|
||||
+
|
||||
+/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */
|
||||
+/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */
|
||||
+/* { dg-final { scan-assembler "mov\[ \t\](%eax|%rax), \\((%esp|%rsp)\\)" } } */
|
||||
+/* { dg-final { scan-assembler {\tpause} } } */
|
||||
+/* { dg-final { scan-assembler-not "push(?:l|q)\[ \t\]*_?dispatch" } } */
|
||||
+/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */
|
||||
+/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-3.c
|
||||
new file mode 100644
|
||||
index 00000000000..5320e923be2
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-3.c
|
||||
@@ -0,0 +1,19 @@
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2 -mindirect-branch=thunk-extern -mindirect-branch-register -fno-pic" } */
|
||||
+
|
||||
+typedef void (*dispatch_t)(long offset);
|
||||
+
|
||||
+dispatch_t dispatch;
|
||||
+
|
||||
+void
|
||||
+male_indirect_jump (long offset)
|
||||
+{
|
||||
+ dispatch(offset);
|
||||
+}
|
||||
+
|
||||
+/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */
|
||||
+/* { dg-final { scan-assembler-not "push(?:l|q)\[ \t\]*_?dispatch" } } */
|
||||
+/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */
|
||||
+/* { dg-final { scan-assembler-not {\t(pause|pause|nop)} } } */
|
||||
+/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */
|
||||
+/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-10.c b/gcc/testsuite/gcc.target/i386/ret-thunk-10.c
|
||||
index 3a6727b5c54..e6fea84a4d9 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/ret-thunk-10.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-10.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=thunk-inline -mindirect-branch=thunk -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=thunk-inline -mindirect-branch=thunk -fno-pic" } */
|
||||
|
||||
extern void (*bar) (void);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-11.c b/gcc/testsuite/gcc.target/i386/ret-thunk-11.c
|
||||
index b8f68188313..e239ec4542f 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/ret-thunk-11.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-11.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=thunk-extern -mindirect-branch=thunk -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=thunk-extern -mindirect-branch=thunk -fno-pic" } */
|
||||
|
||||
extern void (*bar) (void);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-12.c b/gcc/testsuite/gcc.target/i386/ret-thunk-12.c
|
||||
index 01b0a02f80b..fa3181303c9 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/ret-thunk-12.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-12.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
|
||||
|
||||
extern void (*bar) (void);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-13.c b/gcc/testsuite/gcc.target/i386/ret-thunk-13.c
|
||||
index 4b497b5f8af..fd5b41fdd3f 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/ret-thunk-13.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-13.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
|
||||
|
||||
extern void (*bar) (void);
|
||||
extern int foo (void) __attribute__ ((function_return("thunk")));
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-14.c b/gcc/testsuite/gcc.target/i386/ret-thunk-14.c
|
||||
index 4ae4c44a3fd..d606373ead1 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/ret-thunk-14.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-14.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */
|
||||
|
||||
extern void (*bar) (void);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-15.c b/gcc/testsuite/gcc.target/i386/ret-thunk-15.c
|
||||
index 5b5bc765a7e..75e45e226b8 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/ret-thunk-15.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-15.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=keep -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=keep -fno-pic" } */
|
||||
|
||||
extern void (*bar) (void);
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c
|
||||
index fa24a1f7365..d1db41cc128 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
-/* { dg-options "-O2 -mfunction-return=thunk -mindirect-branch=thunk -fno-pic" } */
|
||||
+/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=thunk -mindirect-branch=thunk -fno-pic" } */
|
||||
|
||||
extern void (*bar) (void);
|
||||
|
||||
--
|
||||
2.16.3
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
From 92308185917678406afee3c165ea5e71b53b3cc1 Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Sat, 6 Jan 2018 22:29:56 -0800
|
||||
Subject: [PATCH 07/13] x86: Add 'V' register operand modifier
|
||||
|
||||
Add 'V', a special modifier which prints the name of the full integer
|
||||
register without '%'. For
|
||||
|
||||
extern void (*func_p) (void);
|
||||
|
||||
void
|
||||
foo (void)
|
||||
{
|
||||
asm ("call __x86_indirect_thunk_%V0" : : "a" (func_p));
|
||||
}
|
||||
|
||||
it generates:
|
||||
|
||||
foo:
|
||||
movq func_p(%rip), %rax
|
||||
call __x86_indirect_thunk_rax
|
||||
ret
|
||||
|
||||
gcc/
|
||||
|
||||
Backport from mainline
|
||||
2018-01-14 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* config/i386/i386.c (print_reg): Print the name of the full
|
||||
integer register without '%'.
|
||||
(ix86_print_operand): Handle 'V'.
|
||||
* doc/extend.texi: Document 'V' modifier.
|
||||
|
||||
gcc/testsuite/
|
||||
|
||||
Backport from mainline
|
||||
2018-01-14 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* gcc.target/i386/indirect-thunk-register-4.c: New test.
|
||||
---
|
||||
gcc/config/i386/i386.c | 13 ++++++++++++-
|
||||
gcc/doc/extend.texi | 3 +++
|
||||
gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c | 13 +++++++++++++
|
||||
3 files changed, 28 insertions(+), 1 deletion(-)
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c
|
||||
|
||||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index 34e26a3a3c7..eeca7e5e490 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -16869,6 +16869,7 @@ put_condition_code (enum rtx_code code, machine_mode mode, bool reverse,
|
||||
If CODE is 'h', pretend the reg is the 'high' byte register.
|
||||
If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op.
|
||||
If CODE is 'd', duplicate the operand for AVX instruction.
|
||||
+ If CODE is 'V', print naked full integer register name without %.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -16879,7 +16880,7 @@ print_reg (rtx x, int code, FILE *file)
|
||||
unsigned int regno;
|
||||
bool duplicated;
|
||||
|
||||
- if (ASSEMBLER_DIALECT == ASM_ATT)
|
||||
+ if (ASSEMBLER_DIALECT == ASM_ATT && code != 'V')
|
||||
putc ('%', file);
|
||||
|
||||
if (x == pc_rtx)
|
||||
@@ -16922,6 +16923,14 @@ print_reg (rtx x, int code, FILE *file)
|
||||
&& regno != FPSR_REG
|
||||
&& regno != FPCR_REG);
|
||||
|
||||
+ if (code == 'V')
|
||||
+ {
|
||||
+ if (GENERAL_REGNO_P (regno))
|
||||
+ msize = GET_MODE_SIZE (word_mode);
|
||||
+ else
|
||||
+ error ("'V' modifier on non-integer register");
|
||||
+ }
|
||||
+
|
||||
duplicated = code == 'd' && TARGET_AVX;
|
||||
|
||||
switch (msize)
|
||||
@@ -17035,6 +17044,7 @@ print_reg (rtx x, int code, FILE *file)
|
||||
& -- print some in-use local-dynamic symbol name.
|
||||
H -- print a memory address offset by 8; used for sse high-parts
|
||||
Y -- print condition for XOP pcom* instruction.
|
||||
+ V -- print naked full integer register name without %.
|
||||
+ -- print a branch hint as 'cs' or 'ds' prefix
|
||||
; -- print a semicolon (after prefixes due to bug in older gas).
|
||||
~ -- print "i" if TARGET_AVX2, "f" otherwise.
|
||||
@@ -17259,6 +17269,7 @@ ix86_print_operand (FILE *file, rtx x, int code)
|
||||
case 'X':
|
||||
case 'P':
|
||||
case 'p':
|
||||
+ case 'V':
|
||||
break;
|
||||
|
||||
case 's':
|
||||
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
|
||||
index 2cb6bd1ef3e..76ba1d4f913 100644
|
||||
--- a/gcc/doc/extend.texi
|
||||
+++ b/gcc/doc/extend.texi
|
||||
@@ -8511,6 +8511,9 @@ The table below shows the list of supported modifiers and their effects.
|
||||
@tab @code{2}
|
||||
@end multitable
|
||||
|
||||
+@code{V} is a special modifier which prints the name of the full integer
|
||||
+register without @code{%}.
|
||||
+
|
||||
@anchor{x86floatingpointasmoperands}
|
||||
@subsubsection x86 Floating-Point @code{asm} Operands
|
||||
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c
|
||||
new file mode 100644
|
||||
index 00000000000..f0cd9b75be8
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c
|
||||
@@ -0,0 +1,13 @@
|
||||
+/* { dg-do compile } */
|
||||
+/* { dg-options "-O2 -mindirect-branch=keep -fno-pic" } */
|
||||
+
|
||||
+extern void (*func_p) (void);
|
||||
+
|
||||
+void
|
||||
+foo (void)
|
||||
+{
|
||||
+ asm("call __x86_indirect_thunk_%V0" : : "a" (func_p));
|
||||
+}
|
||||
+
|
||||
+/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_eax" { target ia32 } } } */
|
||||
+/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_rax" { target { ! ia32 } } } } */
|
||||
--
|
||||
2.16.3
|
||||
|
||||
@@ -0,0 +1,299 @@
|
||||
From 087b12213a5b4b8654c70320c671bb05c1b1b012 Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Sat, 13 Jan 2018 18:01:54 -0800
|
||||
Subject: [PATCH 08/13] x86: Disallow -mindirect-branch=/-mfunction-return=
|
||||
with -mcmodel=large
|
||||
|
||||
Since the thunk function may not be reachable in large code model,
|
||||
-mcmodel=large is incompatible with -mindirect-branch=thunk,
|
||||
-mindirect-branch=thunk-extern, -mfunction-return=thunk and
|
||||
-mfunction-return=thunk-extern. Issue an error when they are used with
|
||||
-mcmodel=large.
|
||||
|
||||
gcc/
|
||||
|
||||
Backport from mainline
|
||||
2018-01-14 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* config/i386/i386.c (ix86_set_indirect_branch_type): Disallow
|
||||
-mcmodel=large with -mindirect-branch=thunk,
|
||||
-mindirect-branch=thunk-extern, -mfunction-return=thunk and
|
||||
-mfunction-return=thunk-extern.
|
||||
* doc/invoke.texi: Document -mcmodel=large is incompatible with
|
||||
-mindirect-branch=thunk, -mindirect-branch=thunk-extern,
|
||||
-mfunction-return=thunk and -mfunction-return=thunk-extern.
|
||||
|
||||
gcc/testsuite/
|
||||
|
||||
Backport from mainline
|
||||
2018-01-14 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* gcc.target/i386/indirect-thunk-10.c: New test.
|
||||
* gcc.target/i386/indirect-thunk-8.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-9.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-attr-10.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-attr-11.c: Likewise.
|
||||
* gcc.target/i386/indirect-thunk-attr-9.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-17.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-18.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-19.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-20.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-21.c: Likewise.
|
||||
---
|
||||
gcc/config/i386/i386.c | 26 ++++++++++++++++++++++
|
||||
gcc/doc/invoke.texi | 11 +++++++++
|
||||
gcc/testsuite/gcc.target/i386/indirect-thunk-10.c | 7 ++++++
|
||||
gcc/testsuite/gcc.target/i386/indirect-thunk-8.c | 7 ++++++
|
||||
gcc/testsuite/gcc.target/i386/indirect-thunk-9.c | 7 ++++++
|
||||
.../gcc.target/i386/indirect-thunk-attr-10.c | 9 ++++++++
|
||||
.../gcc.target/i386/indirect-thunk-attr-11.c | 9 ++++++++
|
||||
.../gcc.target/i386/indirect-thunk-attr-9.c | 9 ++++++++
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-17.c | 7 ++++++
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-18.c | 8 +++++++
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-19.c | 8 +++++++
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-20.c | 9 ++++++++
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-21.c | 9 ++++++++
|
||||
13 files changed, 126 insertions(+)
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/indirect-thunk-10.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/indirect-thunk-8.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/indirect-thunk-9.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/indirect-thunk-attr-10.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/indirect-thunk-attr-11.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/indirect-thunk-attr-9.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/ret-thunk-17.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/ret-thunk-18.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/ret-thunk-19.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/ret-thunk-20.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/ret-thunk-21.c
|
||||
|
||||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index eeca7e5e490..9c038bee000 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -6389,6 +6389,19 @@ ix86_set_indirect_branch_type (tree fndecl)
|
||||
}
|
||||
else
|
||||
cfun->machine->indirect_branch_type = ix86_indirect_branch;
|
||||
+
|
||||
+ /* -mcmodel=large is not compatible with -mindirect-branch=thunk
|
||||
+ nor -mindirect-branch=thunk-extern. */
|
||||
+ if ((ix86_cmodel == CM_LARGE || ix86_cmodel == CM_LARGE_PIC)
|
||||
+ && ((cfun->machine->indirect_branch_type
|
||||
+ == indirect_branch_thunk_extern)
|
||||
+ || (cfun->machine->indirect_branch_type
|
||||
+ == indirect_branch_thunk)))
|
||||
+ error ("%<-mindirect-branch=%s%> and %<-mcmodel=large%> are not "
|
||||
+ "compatible",
|
||||
+ ((cfun->machine->indirect_branch_type
|
||||
+ == indirect_branch_thunk_extern)
|
||||
+ ? "thunk-extern" : "thunk"));
|
||||
}
|
||||
|
||||
if (cfun->machine->function_return_type == indirect_branch_unset)
|
||||
@@ -6414,6 +6427,19 @@ ix86_set_indirect_branch_type (tree fndecl)
|
||||
}
|
||||
else
|
||||
cfun->machine->function_return_type = ix86_function_return;
|
||||
+
|
||||
+ /* -mcmodel=large is not compatible with -mfunction-return=thunk
|
||||
+ nor -mfunction-return=thunk-extern. */
|
||||
+ if ((ix86_cmodel == CM_LARGE || ix86_cmodel == CM_LARGE_PIC)
|
||||
+ && ((cfun->machine->function_return_type
|
||||
+ == indirect_branch_thunk_extern)
|
||||
+ || (cfun->machine->function_return_type
|
||||
+ == indirect_branch_thunk)))
|
||||
+ error ("%<-mfunction-return=%s%> and %<-mcmodel=large%> are not "
|
||||
+ "compatible",
|
||||
+ ((cfun->machine->function_return_type
|
||||
+ == indirect_branch_thunk_extern)
|
||||
+ ? "thunk-extern" : "thunk"));
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index 94374661f2d..1dee495c86b 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -24242,6 +24242,11 @@ to external call and return thunk provided in a separate object file.
|
||||
You can control this behavior for a specific function by using the
|
||||
function attribute @code{indirect_branch}. @xref{Function Attributes}.
|
||||
|
||||
+Note that @option{-mcmodel=large} is incompatible with
|
||||
+@option{-mindirect-branch=thunk} nor
|
||||
+@option{-mindirect-branch=thunk-extern} since the thunk function may
|
||||
+not be reachable in large code model.
|
||||
+
|
||||
@item -mfunction-return=@var{choice}
|
||||
@opindex -mfunction-return
|
||||
Convert function return with @var{choice}. The default is @samp{keep},
|
||||
@@ -24253,6 +24258,12 @@ object file. You can control this behavior for a specific function by
|
||||
using the function attribute @code{function_return}.
|
||||
@xref{Function Attributes}.
|
||||
|
||||
+Note that @option{-mcmodel=large} is incompatible with
|
||||
+@option{-mfunction-return=thunk} nor
|
||||
+@option{-mfunction-return=thunk-extern} since the thunk function may
|
||||
+not be reachable in large code model.
|
||||
+
|
||||
+
|
||||
@item -mindirect-branch-register
|
||||
@opindex -mindirect-branch-register
|
||||
Force indirect call and jump via register.
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-10.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-10.c
|
||||
new file mode 100644
|
||||
index 00000000000..a0674bd2363
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-10.c
|
||||
@@ -0,0 +1,7 @@
|
||||
+/* { dg-do compile { target { lp64 } } } */
|
||||
+/* { dg-options "-O2 -mindirect-branch=thunk-inline -mfunction-return=keep -mcmodel=large" } */
|
||||
+
|
||||
+void
|
||||
+bar (void)
|
||||
+{
|
||||
+}
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-8.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-8.c
|
||||
new file mode 100644
|
||||
index 00000000000..7a80a8986e8
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-8.c
|
||||
@@ -0,0 +1,7 @@
|
||||
+/* { dg-do compile { target { lp64 } } } */
|
||||
+/* { dg-options "-O2 -mindirect-branch=thunk -mfunction-return=keep -mcmodel=large" } */
|
||||
+
|
||||
+void
|
||||
+bar (void)
|
||||
+{ /* { dg-error "'-mindirect-branch=thunk' and '-mcmodel=large' are not compatible" } */
|
||||
+}
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-9.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-9.c
|
||||
new file mode 100644
|
||||
index 00000000000..d4d45c5114d
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-9.c
|
||||
@@ -0,0 +1,7 @@
|
||||
+/* { dg-do compile { target { lp64 } } } */
|
||||
+/* { dg-options "-O2 -mindirect-branch=thunk-extern -mfunction-return=keep -mcmodel=large" } */
|
||||
+
|
||||
+void
|
||||
+bar (void)
|
||||
+{ /* { dg-error "'-mindirect-branch=thunk-extern' and '-mcmodel=large' are not compatible" } */
|
||||
+}
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-10.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-10.c
|
||||
new file mode 100644
|
||||
index 00000000000..3a2aeaddbc5
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-10.c
|
||||
@@ -0,0 +1,9 @@
|
||||
+/* { dg-do compile { target { lp64 } } } */
|
||||
+/* { dg-options "-O2 -mindirect-branch=keep -mfunction-return=keep -mcmodel=large" } */
|
||||
+/* { dg-additional-options "-fPIC" { target fpic } } */
|
||||
+
|
||||
+__attribute__ ((indirect_branch("thunk-extern")))
|
||||
+void
|
||||
+bar (void)
|
||||
+{ /* { dg-error "'-mindirect-branch=thunk-extern' and '-mcmodel=large' are not compatible" } */
|
||||
+}
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-11.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-11.c
|
||||
new file mode 100644
|
||||
index 00000000000..8e52f032b6c
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-11.c
|
||||
@@ -0,0 +1,9 @@
|
||||
+/* { dg-do compile { target { lp64 } } } */
|
||||
+/* { dg-options "-O2 -mindirect-branch=keep -mfunction-return=keep -mcmodel=large" } */
|
||||
+/* { dg-additional-options "-fPIC" { target fpic } } */
|
||||
+
|
||||
+__attribute__ ((indirect_branch("thunk-inline")))
|
||||
+void
|
||||
+bar (void)
|
||||
+{
|
||||
+}
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-9.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-9.c
|
||||
new file mode 100644
|
||||
index 00000000000..bdaa4f6911b
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-9.c
|
||||
@@ -0,0 +1,9 @@
|
||||
+/* { dg-do compile { target { lp64 } } } */
|
||||
+/* { dg-options "-O2 -mindirect-branch=keep -mfunction-return=keep -mcmodel=large" } */
|
||||
+/* { dg-additional-options "-fPIC" { target fpic } } */
|
||||
+
|
||||
+__attribute__ ((indirect_branch("thunk")))
|
||||
+void
|
||||
+bar (void)
|
||||
+{ /* { dg-error "'-mindirect-branch=thunk' and '-mcmodel=large' are not compatible" } */
|
||||
+}
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-17.c b/gcc/testsuite/gcc.target/i386/ret-thunk-17.c
|
||||
new file mode 100644
|
||||
index 00000000000..0605e2c6542
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-17.c
|
||||
@@ -0,0 +1,7 @@
|
||||
+/* { dg-do compile { target { lp64 } } } */
|
||||
+/* { dg-options "-O2 -mfunction-return=thunk -mindirect-branch=keep -mcmodel=large" } */
|
||||
+
|
||||
+void
|
||||
+bar (void)
|
||||
+{ /* { dg-error "'-mfunction-return=thunk' and '-mcmodel=large' are not compatible" } */
|
||||
+}
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-18.c b/gcc/testsuite/gcc.target/i386/ret-thunk-18.c
|
||||
new file mode 100644
|
||||
index 00000000000..307019dc242
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-18.c
|
||||
@@ -0,0 +1,8 @@
|
||||
+/* { dg-do compile { target { lp64 } } } */
|
||||
+/* { dg-options "-O2 -mfunction-return=thunk-extern -mindirect-branch=keep -mcmodel=large" } */
|
||||
+/* { dg-additional-options "-fPIC" { target fpic } } */
|
||||
+
|
||||
+void
|
||||
+bar (void)
|
||||
+{ /* { dg-error "'-mfunction-return=thunk-extern' and '-mcmodel=large' are not compatible" } */
|
||||
+}
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-19.c b/gcc/testsuite/gcc.target/i386/ret-thunk-19.c
|
||||
new file mode 100644
|
||||
index 00000000000..772617f4010
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-19.c
|
||||
@@ -0,0 +1,8 @@
|
||||
+/* { dg-do compile { target { lp64 } } } */
|
||||
+/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=keep -mcmodel=large" } */
|
||||
+
|
||||
+__attribute__ ((function_return("thunk")))
|
||||
+void
|
||||
+bar (void)
|
||||
+{ /* { dg-error "'-mfunction-return=thunk' and '-mcmodel=large' are not compatible" } */
|
||||
+}
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-20.c b/gcc/testsuite/gcc.target/i386/ret-thunk-20.c
|
||||
new file mode 100644
|
||||
index 00000000000..1e9f9bd5a66
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-20.c
|
||||
@@ -0,0 +1,9 @@
|
||||
+/* { dg-do compile { target { lp64 } } } */
|
||||
+/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=keep -mcmodel=large" } */
|
||||
+/* { dg-additional-options "-fPIC" { target fpic } } */
|
||||
+
|
||||
+__attribute__ ((function_return("thunk-extern")))
|
||||
+void
|
||||
+bar (void)
|
||||
+{ /* { dg-error "'-mfunction-return=thunk-extern' and '-mcmodel=large' are not compatible" } */
|
||||
+}
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-21.c b/gcc/testsuite/gcc.target/i386/ret-thunk-21.c
|
||||
new file mode 100644
|
||||
index 00000000000..eea07f7abe1
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-21.c
|
||||
@@ -0,0 +1,9 @@
|
||||
+/* { dg-do compile { target { lp64 } } } */
|
||||
+/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=keep -mcmodel=large" } */
|
||||
+/* { dg-additional-options "-fPIC" { target fpic } } */
|
||||
+
|
||||
+__attribute__ ((function_return("thunk-inline")))
|
||||
+void
|
||||
+bar (void)
|
||||
+{
|
||||
+}
|
||||
--
|
||||
2.16.3
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
From 07857bd9fb9ccab67a932ad9df3e53f3f0c2c617 Mon Sep 17 00:00:00 2001
|
||||
From: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Thu, 25 Jan 2018 19:39:01 +0000
|
||||
Subject: [PATCH 09/13] Use INVALID_REGNUM in indirect thunk processing
|
||||
|
||||
Backport from mainline
|
||||
2018-01-17 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
* config/i386/i386.c (indirect_thunk_name): Declare regno
|
||||
as unsigned int. Compare regno with INVALID_REGNUM.
|
||||
(output_indirect_thunk): Ditto.
|
||||
(output_indirect_thunk_function): Ditto.
|
||||
(ix86_code_end): Declare regno as unsigned int. Use INVALID_REGNUM
|
||||
in the call to output_indirect_thunk_function.
|
||||
|
||||
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@257067 138bc75d-0d04-0410-961f-82ee72b054a4
|
||||
---
|
||||
gcc/config/i386/i386.c | 30 +++++++++++++++---------------
|
||||
1 file changed, 15 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index 9c038bee000..40126579c22 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -11087,16 +11087,16 @@ static int indirect_thunks_bnd_used;
|
||||
/* Fills in the label name that should be used for the indirect thunk. */
|
||||
|
||||
static void
|
||||
-indirect_thunk_name (char name[32], int regno, bool need_bnd_p,
|
||||
- bool ret_p)
|
||||
+indirect_thunk_name (char name[32], unsigned int regno,
|
||||
+ bool need_bnd_p, bool ret_p)
|
||||
{
|
||||
- if (regno >= 0 && ret_p)
|
||||
+ if (regno != INVALID_REGNUM && ret_p)
|
||||
gcc_unreachable ();
|
||||
|
||||
if (USE_HIDDEN_LINKONCE)
|
||||
{
|
||||
const char *bnd = need_bnd_p ? "_bnd" : "";
|
||||
- if (regno >= 0)
|
||||
+ if (regno != INVALID_REGNUM)
|
||||
{
|
||||
const char *reg_prefix;
|
||||
if (LEGACY_INT_REGNO_P (regno))
|
||||
@@ -11114,7 +11114,7 @@ indirect_thunk_name (char name[32], int regno, bool need_bnd_p,
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (regno >= 0)
|
||||
+ if (regno != INVALID_REGNUM)
|
||||
{
|
||||
if (need_bnd_p)
|
||||
ASM_GENERATE_INTERNAL_LABEL (name, "LITBR", regno);
|
||||
@@ -11166,7 +11166,7 @@ indirect_thunk_name (char name[32], int regno, bool need_bnd_p,
|
||||
*/
|
||||
|
||||
static void
|
||||
-output_indirect_thunk (bool need_bnd_p, int regno)
|
||||
+output_indirect_thunk (bool need_bnd_p, unsigned int regno)
|
||||
{
|
||||
char indirectlabel1[32];
|
||||
char indirectlabel2[32];
|
||||
@@ -11196,7 +11196,7 @@ output_indirect_thunk (bool need_bnd_p, int regno)
|
||||
|
||||
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, indirectlabel2);
|
||||
|
||||
- if (regno >= 0)
|
||||
+ if (regno != INVALID_REGNUM)
|
||||
{
|
||||
/* MOV. */
|
||||
rtx xops[2];
|
||||
@@ -11220,12 +11220,12 @@ output_indirect_thunk (bool need_bnd_p, int regno)
|
||||
}
|
||||
|
||||
/* Output a funtion with a call and return thunk for indirect branch.
|
||||
- If BND_P is true, the BND prefix is needed. If REGNO != -1, the
|
||||
- function address is in REGNO. Otherwise, the function address is
|
||||
+ If BND_P is true, the BND prefix is needed. If REGNO != INVALID_REGNUM,
|
||||
+ the function address is in REGNO. Otherwise, the function address is
|
||||
on the top of stack. */
|
||||
|
||||
static void
|
||||
-output_indirect_thunk_function (bool need_bnd_p, int regno)
|
||||
+output_indirect_thunk_function (bool need_bnd_p, unsigned int regno)
|
||||
{
|
||||
char name[32];
|
||||
tree decl;
|
||||
@@ -11274,7 +11274,7 @@ output_indirect_thunk_function (bool need_bnd_p, int regno)
|
||||
ASM_OUTPUT_LABEL (asm_out_file, name);
|
||||
}
|
||||
|
||||
- if (regno < 0)
|
||||
+ if (regno == INVALID_REGNUM)
|
||||
{
|
||||
/* Create alias for __x86.return_thunk/__x86.return_thunk_bnd. */
|
||||
char alias[32];
|
||||
@@ -11348,16 +11348,16 @@ static void
|
||||
ix86_code_end (void)
|
||||
{
|
||||
rtx xops[2];
|
||||
- int regno;
|
||||
+ unsigned int regno;
|
||||
|
||||
if (indirect_thunk_needed)
|
||||
- output_indirect_thunk_function (false, -1);
|
||||
+ output_indirect_thunk_function (false, INVALID_REGNUM);
|
||||
if (indirect_thunk_bnd_needed)
|
||||
- output_indirect_thunk_function (true, -1);
|
||||
+ output_indirect_thunk_function (true, INVALID_REGNUM);
|
||||
|
||||
for (regno = FIRST_REX_INT_REG; regno <= LAST_REX_INT_REG; regno++)
|
||||
{
|
||||
- int i = regno - FIRST_REX_INT_REG + LAST_INT_REG + 1;
|
||||
+ unsigned int i = regno - FIRST_REX_INT_REG + LAST_INT_REG + 1;
|
||||
if ((indirect_thunks_used & (1 << i)))
|
||||
output_indirect_thunk_function (false, regno);
|
||||
|
||||
--
|
||||
2.16.3
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
From 3815e98f0f46b6c4c41e6810bad987bd083691aa Mon Sep 17 00:00:00 2001
|
||||
From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Fri, 2 Feb 2018 16:47:02 +0000
|
||||
Subject: [PATCH 10/13] i386: Pass INVALID_REGNUM as invalid register number
|
||||
|
||||
Backport from mainline
|
||||
* config/i386/i386.c (ix86_output_function_return): Pass
|
||||
INVALID_REGNUM, instead of -1, as invalid register number to
|
||||
indirect_thunk_name and output_indirect_thunk.
|
||||
|
||||
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@257341 138bc75d-0d04-0410-961f-82ee72b054a4
|
||||
---
|
||||
gcc/config/i386/i386.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index 40126579c22..66502ee6da6 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -28056,7 +28056,8 @@ ix86_output_function_return (bool long_p)
|
||||
{
|
||||
bool need_thunk = (cfun->machine->function_return_type
|
||||
== indirect_branch_thunk);
|
||||
- indirect_thunk_name (thunk_name, -1, need_bnd_p, true);
|
||||
+ indirect_thunk_name (thunk_name, INVALID_REGNUM, need_bnd_p,
|
||||
+ true);
|
||||
if (need_bnd_p)
|
||||
{
|
||||
indirect_thunk_bnd_needed |= need_thunk;
|
||||
@@ -28069,7 +28070,7 @@ ix86_output_function_return (bool long_p)
|
||||
}
|
||||
}
|
||||
else
|
||||
- output_indirect_thunk (need_bnd_p, -1);
|
||||
+ output_indirect_thunk (need_bnd_p, INVALID_REGNUM);
|
||||
|
||||
return "";
|
||||
}
|
||||
--
|
||||
2.16.3
|
||||
|
||||
@@ -0,0 +1,456 @@
|
||||
From 771535dec733e4b85924f00a3a94c29683d614e5 Mon Sep 17 00:00:00 2001
|
||||
From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Mon, 26 Feb 2018 15:29:30 +0000
|
||||
Subject: [PATCH 11/13] i386: Update -mfunction-return= for return with pop
|
||||
|
||||
When -mfunction-return= is used, simple_return_pop_internal should pop
|
||||
return address into ECX register, adjust stack by bytes to pop from stack
|
||||
and jump to the return thunk via ECX register.
|
||||
|
||||
Revision 257992 removed the bool argument from ix86_output_indirect_jmp.
|
||||
Update comments to reflect it.
|
||||
|
||||
Tested on i686 and x86-64.
|
||||
|
||||
gcc/
|
||||
|
||||
Backport from mainline
|
||||
2018-02-26 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* config/i386/i386.c (ix86_output_indirect_jmp): Update comments.
|
||||
|
||||
2018-02-26 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR target/84530
|
||||
* config/i386/i386-protos.h (ix86_output_indirect_jmp): Remove
|
||||
the bool argument.
|
||||
(ix86_output_indirect_function_return): New prototype.
|
||||
(ix86_split_simple_return_pop_internal): Likewise.
|
||||
* config/i386/i386.c (indirect_return_via_cx): New.
|
||||
(indirect_return_via_cx_bnd): Likewise.
|
||||
(indirect_thunk_name): Handle return va CX_REG.
|
||||
(output_indirect_thunk_function): Create alias for
|
||||
__x86_return_thunk_[re]cx and __x86_return_thunk_[re]cx_bnd.
|
||||
(ix86_output_indirect_jmp): Remove the bool argument.
|
||||
(ix86_output_indirect_function_return): New function.
|
||||
(ix86_split_simple_return_pop_internal): Likewise.
|
||||
* config/i386/i386.md (*indirect_jump): Don't pass false
|
||||
to ix86_output_indirect_jmp.
|
||||
(*tablejump_1): Likewise.
|
||||
(simple_return_pop_internal): Change it to define_insn_and_split.
|
||||
Call ix86_split_simple_return_pop_internal to split it for
|
||||
-mfunction-return=.
|
||||
(simple_return_indirect_internal): Call
|
||||
ix86_output_indirect_function_return instead of
|
||||
ix86_output_indirect_jmp.
|
||||
|
||||
gcc/testsuite/
|
||||
|
||||
Backport from mainline
|
||||
2018-02-26 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR target/84530
|
||||
* gcc.target/i386/ret-thunk-22.c: New test.
|
||||
* gcc.target/i386/ret-thunk-23.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-24.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-25.c: Likewise.
|
||||
* gcc.target/i386/ret-thunk-26.c: Likewise.
|
||||
---
|
||||
gcc/config/i386/i386-protos.h | 4 +-
|
||||
gcc/config/i386/i386.c | 127 +++++++++++++++++++++++----
|
||||
gcc/config/i386/i386.md | 11 ++-
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-22.c | 15 ++++
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-23.c | 15 ++++
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-24.c | 15 ++++
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-25.c | 15 ++++
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-26.c | 40 +++++++++
|
||||
8 files changed, 222 insertions(+), 20 deletions(-)
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/ret-thunk-22.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/ret-thunk-23.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/ret-thunk-24.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/ret-thunk-25.c
|
||||
create mode 100644 gcc/testsuite/gcc.target/i386/ret-thunk-26.c
|
||||
|
||||
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
|
||||
index 620d70ef9f6..c7a0ccb58d3 100644
|
||||
--- a/gcc/config/i386/i386-protos.h
|
||||
+++ b/gcc/config/i386/i386-protos.h
|
||||
@@ -311,8 +311,10 @@ extern enum attr_cpu ix86_schedule;
|
||||
#endif
|
||||
|
||||
extern const char * ix86_output_call_insn (rtx_insn *insn, rtx call_op);
|
||||
-extern const char * ix86_output_indirect_jmp (rtx call_op, bool ret_p);
|
||||
+extern const char * ix86_output_indirect_jmp (rtx call_op);
|
||||
extern const char * ix86_output_function_return (bool long_p);
|
||||
+extern const char * ix86_output_indirect_function_return (rtx ret_op);
|
||||
+extern void ix86_split_simple_return_pop_internal (rtx);
|
||||
extern bool ix86_operands_ok_for_move_multiple (rtx *operands, bool load,
|
||||
enum machine_mode mode);
|
||||
|
||||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index 66502ee6da6..21c3c18bd3c 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -11080,6 +11080,12 @@ static int indirect_thunks_used;
|
||||
by call and return thunks functions with the BND prefix. */
|
||||
static int indirect_thunks_bnd_used;
|
||||
|
||||
+/* True if return thunk function via CX is needed. */
|
||||
+static bool indirect_return_via_cx;
|
||||
+/* True if return thunk function via CX with the BND prefix is
|
||||
+ needed. */
|
||||
+static bool indirect_return_via_cx_bnd;
|
||||
+
|
||||
#ifndef INDIRECT_LABEL
|
||||
# define INDIRECT_LABEL "LIND"
|
||||
#endif
|
||||
@@ -11090,12 +11096,13 @@ static void
|
||||
indirect_thunk_name (char name[32], unsigned int regno,
|
||||
bool need_bnd_p, bool ret_p)
|
||||
{
|
||||
- if (regno != INVALID_REGNUM && ret_p)
|
||||
+ if (regno != INVALID_REGNUM && regno != CX_REG && ret_p)
|
||||
gcc_unreachable ();
|
||||
|
||||
if (USE_HIDDEN_LINKONCE)
|
||||
{
|
||||
const char *bnd = need_bnd_p ? "_bnd" : "";
|
||||
+ const char *ret = ret_p ? "return" : "indirect";
|
||||
if (regno != INVALID_REGNUM)
|
||||
{
|
||||
const char *reg_prefix;
|
||||
@@ -11103,14 +11110,11 @@ indirect_thunk_name (char name[32], unsigned int regno,
|
||||
reg_prefix = TARGET_64BIT ? "r" : "e";
|
||||
else
|
||||
reg_prefix = "";
|
||||
- sprintf (name, "__x86_indirect_thunk%s_%s%s",
|
||||
- bnd, reg_prefix, reg_names[regno]);
|
||||
+ sprintf (name, "__x86_%s_thunk%s_%s%s",
|
||||
+ ret, bnd, reg_prefix, reg_names[regno]);
|
||||
}
|
||||
else
|
||||
- {
|
||||
- const char *ret = ret_p ? "return" : "indirect";
|
||||
- sprintf (name, "__x86_%s_thunk%s", ret, bnd);
|
||||
- }
|
||||
+ sprintf (name, "__x86_%s_thunk%s", ret, bnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -11274,9 +11278,23 @@ output_indirect_thunk_function (bool need_bnd_p, unsigned int regno)
|
||||
ASM_OUTPUT_LABEL (asm_out_file, name);
|
||||
}
|
||||
|
||||
+ /* Create alias for __x86_return_thunk/__x86_return_thunk_bnd or
|
||||
+ __x86_return_thunk_ecx/__x86_return_thunk_ecx_bnd. */
|
||||
+ bool need_alias;
|
||||
if (regno == INVALID_REGNUM)
|
||||
+ need_alias = true;
|
||||
+ else if (regno == CX_REG)
|
||||
+ {
|
||||
+ if (need_bnd_p)
|
||||
+ need_alias = indirect_return_via_cx_bnd;
|
||||
+ else
|
||||
+ need_alias = indirect_return_via_cx;
|
||||
+ }
|
||||
+ else
|
||||
+ need_alias = false;
|
||||
+
|
||||
+ if (need_alias)
|
||||
{
|
||||
- /* Create alias for __x86.return_thunk/__x86.return_thunk_bnd. */
|
||||
char alias[32];
|
||||
|
||||
indirect_thunk_name (alias, regno, need_bnd_p, true);
|
||||
@@ -28019,18 +28037,17 @@ ix86_output_indirect_branch (rtx call_op, const char *xasm,
|
||||
else
|
||||
ix86_output_indirect_branch_via_push (call_op, xasm, sibcall_p);
|
||||
}
|
||||
-/* Output indirect jump. CALL_OP is the jump target. Jump is a
|
||||
- function return if RET_P is true. */
|
||||
+
|
||||
+/* Output indirect jump. CALL_OP is the jump target. */
|
||||
|
||||
const char *
|
||||
-ix86_output_indirect_jmp (rtx call_op, bool ret_p)
|
||||
+ix86_output_indirect_jmp (rtx call_op)
|
||||
{
|
||||
if (cfun->machine->indirect_branch_type != indirect_branch_keep)
|
||||
{
|
||||
- /* We can't have red-zone if this isn't a function return since
|
||||
- "call" in the indirect thunk pushes the return address onto
|
||||
- stack, destroying red-zone. */
|
||||
- if (!ret_p && ix86_red_zone_size != 0)
|
||||
+ /* We can't have red-zone since "call" in the indirect thunk
|
||||
+ pushes the return address onto stack, destroying red-zone. */
|
||||
+ if (ix86_red_zone_size != 0)
|
||||
gcc_unreachable ();
|
||||
|
||||
ix86_output_indirect_branch (call_op, "%0", true);
|
||||
@@ -28081,6 +28098,86 @@ ix86_output_function_return (bool long_p)
|
||||
return "rep%; ret";
|
||||
}
|
||||
|
||||
+/* Output indirect function return. RET_OP is the function return
|
||||
+ target. */
|
||||
+
|
||||
+const char *
|
||||
+ix86_output_indirect_function_return (rtx ret_op)
|
||||
+{
|
||||
+ if (cfun->machine->function_return_type != indirect_branch_keep)
|
||||
+ {
|
||||
+ char thunk_name[32];
|
||||
+ bool need_bnd_p = ix86_bnd_prefixed_insn_p (current_output_insn);
|
||||
+ unsigned int regno = REGNO (ret_op);
|
||||
+ gcc_assert (regno == CX_REG);
|
||||
+
|
||||
+ if (cfun->machine->function_return_type
|
||||
+ != indirect_branch_thunk_inline)
|
||||
+ {
|
||||
+ bool need_thunk = (cfun->machine->function_return_type
|
||||
+ == indirect_branch_thunk);
|
||||
+ indirect_thunk_name (thunk_name, regno, need_bnd_p, true);
|
||||
+ if (need_bnd_p)
|
||||
+ {
|
||||
+ if (need_thunk)
|
||||
+ {
|
||||
+ indirect_return_via_cx_bnd = true;
|
||||
+ indirect_thunks_bnd_used |= 1 << CX_REG;
|
||||
+ }
|
||||
+ fprintf (asm_out_file, "\tbnd jmp\t%s\n", thunk_name);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (need_thunk)
|
||||
+ {
|
||||
+ indirect_return_via_cx = true;
|
||||
+ indirect_thunks_used |= 1 << CX_REG;
|
||||
+ }
|
||||
+ fprintf (asm_out_file, "\tjmp\t%s\n", thunk_name);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ output_indirect_thunk (need_bnd_p, regno);
|
||||
+
|
||||
+ return "";
|
||||
+ }
|
||||
+ else
|
||||
+ return "%!jmp\t%A0";
|
||||
+}
|
||||
+
|
||||
+/* Split simple return with popping POPC bytes from stack to indirect
|
||||
+ branch with stack adjustment . */
|
||||
+
|
||||
+void
|
||||
+ix86_split_simple_return_pop_internal (rtx popc)
|
||||
+{
|
||||
+ struct machine_function *m = cfun->machine;
|
||||
+ rtx ecx = gen_rtx_REG (SImode, CX_REG);
|
||||
+ rtx_insn *insn;
|
||||
+
|
||||
+ /* There is no "pascal" calling convention in any 64bit ABI. */
|
||||
+ gcc_assert (!TARGET_64BIT);
|
||||
+
|
||||
+ insn = emit_insn (gen_pop (ecx));
|
||||
+ m->fs.cfa_offset -= UNITS_PER_WORD;
|
||||
+ m->fs.sp_offset -= UNITS_PER_WORD;
|
||||
+
|
||||
+ rtx x = plus_constant (Pmode, stack_pointer_rtx, UNITS_PER_WORD);
|
||||
+ x = gen_rtx_SET (stack_pointer_rtx, x);
|
||||
+ add_reg_note (insn, REG_CFA_ADJUST_CFA, x);
|
||||
+ add_reg_note (insn, REG_CFA_REGISTER, gen_rtx_SET (ecx, pc_rtx));
|
||||
+ RTX_FRAME_RELATED_P (insn) = 1;
|
||||
+
|
||||
+ x = gen_rtx_PLUS (Pmode, stack_pointer_rtx, popc);
|
||||
+ x = gen_rtx_SET (stack_pointer_rtx, x);
|
||||
+ insn = emit_insn (x);
|
||||
+ add_reg_note (insn, REG_CFA_ADJUST_CFA, x);
|
||||
+ RTX_FRAME_RELATED_P (insn) = 1;
|
||||
+
|
||||
+ /* Now return address is in ECX. */
|
||||
+ emit_jump_insn (gen_simple_return_indirect_internal (ecx));
|
||||
+}
|
||||
+
|
||||
/* Output the assembly for a call instruction. */
|
||||
|
||||
const char *
|
||||
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
|
||||
index 05a88fff356..857466a6361 100644
|
||||
--- a/gcc/config/i386/i386.md
|
||||
+++ b/gcc/config/i386/i386.md
|
||||
@@ -11813,7 +11813,7 @@
|
||||
(define_insn "*indirect_jump"
|
||||
[(set (pc) (match_operand:W 0 "indirect_branch_operand" "rBw"))]
|
||||
""
|
||||
- "* return ix86_output_indirect_jmp (operands[0], false);"
|
||||
+ "* return ix86_output_indirect_jmp (operands[0]);"
|
||||
[(set (attr "type")
|
||||
(if_then_else (match_test "(cfun->machine->indirect_branch_type
|
||||
!= indirect_branch_keep)")
|
||||
@@ -11868,7 +11868,7 @@
|
||||
[(set (pc) (match_operand:W 0 "indirect_branch_operand" "rBw"))
|
||||
(use (label_ref (match_operand 1)))]
|
||||
""
|
||||
- "* return ix86_output_indirect_jmp (operands[0], false);"
|
||||
+ "* return ix86_output_indirect_jmp (operands[0]);"
|
||||
[(set (attr "type")
|
||||
(if_then_else (match_test "(cfun->machine->indirect_branch_type
|
||||
!= indirect_branch_keep)")
|
||||
@@ -12520,11 +12520,14 @@
|
||||
(set_attr "prefix_rep" "1")
|
||||
(set_attr "modrm" "0")])
|
||||
|
||||
-(define_insn "simple_return_pop_internal"
|
||||
+(define_insn_and_split "simple_return_pop_internal"
|
||||
[(simple_return)
|
||||
(use (match_operand:SI 0 "const_int_operand"))]
|
||||
"reload_completed"
|
||||
"%!ret\t%0"
|
||||
+ "&& cfun->machine->function_return_type != indirect_branch_keep"
|
||||
+ [(const_int 0)]
|
||||
+ "ix86_split_simple_return_pop_internal (operands[0]); DONE;"
|
||||
[(set_attr "length" "3")
|
||||
(set_attr "atom_unit" "jeu")
|
||||
(set_attr "length_immediate" "2")
|
||||
@@ -12535,7 +12538,7 @@
|
||||
[(simple_return)
|
||||
(use (match_operand:SI 0 "register_operand" "r"))]
|
||||
"reload_completed"
|
||||
- "* return ix86_output_indirect_jmp (operands[0], true);"
|
||||
+ "* return ix86_output_indirect_function_return (operands[0]);"
|
||||
[(set (attr "type")
|
||||
(if_then_else (match_test "(cfun->machine->indirect_branch_type
|
||||
!= indirect_branch_keep)")
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-22.c b/gcc/testsuite/gcc.target/i386/ret-thunk-22.c
|
||||
new file mode 100644
|
||||
index 00000000000..89e086de97b
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-22.c
|
||||
@@ -0,0 +1,15 @@
|
||||
+/* PR target/r84530 */
|
||||
+/* { dg-do compile { target ia32 } } */
|
||||
+/* { dg-options "-O2 -mfunction-return=thunk" } */
|
||||
+
|
||||
+struct s { _Complex unsigned short x; };
|
||||
+struct s gs = { 100 + 200i };
|
||||
+struct s __attribute__((noinline)) foo (void) { return gs; }
|
||||
+
|
||||
+/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 } } */
|
||||
+/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" } } */
|
||||
+/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk_ecx" } } */
|
||||
+/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */
|
||||
+/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */
|
||||
+/* { dg-final { scan-assembler {\tpause} } } */
|
||||
+/* { dg-final { scan-assembler {\tlfence} } } */
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-23.c b/gcc/testsuite/gcc.target/i386/ret-thunk-23.c
|
||||
new file mode 100644
|
||||
index 00000000000..43f0ccaa854
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-23.c
|
||||
@@ -0,0 +1,15 @@
|
||||
+/* PR target/r84530 */
|
||||
+/* { dg-do compile { target ia32 } } */
|
||||
+/* { dg-options "-O2 -mfunction-return=thunk-extern" } */
|
||||
+
|
||||
+struct s { _Complex unsigned short x; };
|
||||
+struct s gs = { 100 + 200i };
|
||||
+struct s __attribute__((noinline)) foo (void) { return gs; }
|
||||
+
|
||||
+/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 } } */
|
||||
+/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" } } */
|
||||
+/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk_ecx" } } */
|
||||
+/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */
|
||||
+/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */
|
||||
+/* { dg-final { scan-assembler-not {\tpause} } } */
|
||||
+/* { dg-final { scan-assembler-not {\tlfence} } } */
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-24.c b/gcc/testsuite/gcc.target/i386/ret-thunk-24.c
|
||||
new file mode 100644
|
||||
index 00000000000..8729e35147e
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-24.c
|
||||
@@ -0,0 +1,15 @@
|
||||
+/* PR target/r84530 */
|
||||
+/* { dg-do compile { target ia32 } } */
|
||||
+/* { dg-options "-O2 -mfunction-return=thunk-inline" } */
|
||||
+
|
||||
+struct s { _Complex unsigned short x; };
|
||||
+struct s gs = { 100 + 200i };
|
||||
+struct s __attribute__((noinline)) foo (void) { return gs; }
|
||||
+
|
||||
+/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 } } */
|
||||
+/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" } } */
|
||||
+/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk_ecx" } } */
|
||||
+/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */
|
||||
+/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */
|
||||
+/* { dg-final { scan-assembler {\tpause} } } */
|
||||
+/* { dg-final { scan-assembler {\tlfence} } } */
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-25.c b/gcc/testsuite/gcc.target/i386/ret-thunk-25.c
|
||||
new file mode 100644
|
||||
index 00000000000..f73553c9a9f
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-25.c
|
||||
@@ -0,0 +1,15 @@
|
||||
+/* PR target/r84530 */
|
||||
+/* { dg-do compile { target ia32 } } */
|
||||
+/* { dg-options "-O2 -mfunction-return=thunk -fcheck-pointer-bounds -mmpx -fno-pic" } */
|
||||
+
|
||||
+struct s { _Complex unsigned short x; };
|
||||
+struct s gs = { 100 + 200i };
|
||||
+struct s __attribute__((noinline)) foo (void) { return gs; }
|
||||
+
|
||||
+/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 } } */
|
||||
+/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" } } */
|
||||
+/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk_bnd_ecx" } } */
|
||||
+/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */
|
||||
+/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */
|
||||
+/* { dg-final { scan-assembler {\tpause} } } */
|
||||
+/* { dg-final { scan-assembler {\tlfence} } } */
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-26.c b/gcc/testsuite/gcc.target/i386/ret-thunk-26.c
|
||||
new file mode 100644
|
||||
index 00000000000..9144e988735
|
||||
--- /dev/null
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-26.c
|
||||
@@ -0,0 +1,40 @@
|
||||
+/* PR target/r84530 */
|
||||
+/* { dg-do run } */
|
||||
+/* { dg-options "-Os -mfunction-return=thunk" } */
|
||||
+
|
||||
+struct S { int i; };
|
||||
+__attribute__((const, noinline, noclone))
|
||||
+struct S foo (int x)
|
||||
+{
|
||||
+ struct S s;
|
||||
+ s.i = x;
|
||||
+ return s;
|
||||
+}
|
||||
+
|
||||
+int a[2048], b[2048], c[2048], d[2048];
|
||||
+struct S e[2048];
|
||||
+
|
||||
+__attribute__((noinline, noclone)) void
|
||||
+bar (void)
|
||||
+{
|
||||
+ int i;
|
||||
+ for (i = 0; i < 1024; i++)
|
||||
+ {
|
||||
+ e[i] = foo (i);
|
||||
+ a[i+2] = a[i] + a[i+1];
|
||||
+ b[10] = b[10] + i;
|
||||
+ c[i] = c[2047 - i];
|
||||
+ d[i] = d[i + 1];
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+ int i;
|
||||
+ bar ();
|
||||
+ for (i = 0; i < 1024; i++)
|
||||
+ if (e[i].i != i)
|
||||
+ __builtin_abort ();
|
||||
+ return 0;
|
||||
+}
|
||||
--
|
||||
2.16.3
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,225 @@
|
||||
From e7fbaebc8ff650df76f43e92cb9ca59d5174ebe7 Mon Sep 17 00:00:00 2001
|
||||
From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Thu, 15 Mar 2018 17:54:40 +0000
|
||||
Subject: [PATCH 13/13] i386: Don't generate alias for function return thunk
|
||||
|
||||
Function return thunks shouldn't be aliased to indirect branch thunks
|
||||
since indirect branch thunks are placed in COMDAT section and a COMDAT
|
||||
section with indirect branch may not have function return thunk. This
|
||||
patch generates function return thunks directly.
|
||||
|
||||
gcc/
|
||||
|
||||
Backport from mainline
|
||||
PR target/84574
|
||||
* config/i386/i386.c (indirect_thunk_needed): Update comments.
|
||||
(indirect_thunk_bnd_needed): Likewise.
|
||||
(indirect_thunks_used): Likewise.
|
||||
(indirect_thunks_bnd_used): Likewise.
|
||||
(indirect_return_needed): New.
|
||||
(indirect_return_bnd_needed): Likewise.
|
||||
(output_indirect_thunk_function): Add a bool argument for
|
||||
function return.
|
||||
(output_indirect_thunk_function): Don't generate alias for
|
||||
function return thunk.
|
||||
(ix86_code_end): Call output_indirect_thunk_function to generate
|
||||
function return thunks.
|
||||
(ix86_output_function_return): Set indirect_return_bnd_needed
|
||||
and indirect_return_needed instead of indirect_thunk_bnd_needed
|
||||
and indirect_thunk_needed.
|
||||
|
||||
gcc/testsuite/
|
||||
|
||||
Backport from mainline
|
||||
PR target/84574
|
||||
* gcc.target/i386/ret-thunk-9.c: Expect __x86_return_thunk
|
||||
label instead of __x86_indirect_thunk label.
|
||||
---
|
||||
gcc/config/i386/i386.c | 92 ++++++++++-------------------
|
||||
gcc/testsuite/gcc.target/i386/ret-thunk-9.c | 2 +-
|
||||
2 files changed, 33 insertions(+), 61 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index 21c3c18bd3c..f4cd1c6f4e9 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -11067,19 +11067,23 @@ ix86_setup_frame_addresses (void)
|
||||
labels in call and return thunks. */
|
||||
static int indirectlabelno;
|
||||
|
||||
-/* True if call and return thunk functions are needed. */
|
||||
+/* True if call thunk function is needed. */
|
||||
static bool indirect_thunk_needed = false;
|
||||
-/* True if call and return thunk functions with the BND prefix are
|
||||
- needed. */
|
||||
+/* True if call thunk function with the BND prefix is needed. */
|
||||
static bool indirect_thunk_bnd_needed = false;
|
||||
|
||||
/* Bit masks of integer registers, which contain branch target, used
|
||||
- by call and return thunks functions. */
|
||||
+ by call thunk functions. */
|
||||
static int indirect_thunks_used;
|
||||
/* Bit masks of integer registers, which contain branch target, used
|
||||
- by call and return thunks functions with the BND prefix. */
|
||||
+ by call thunk functions with the BND prefix. */
|
||||
static int indirect_thunks_bnd_used;
|
||||
|
||||
+/* True if return thunk function is needed. */
|
||||
+static bool indirect_return_needed = false;
|
||||
+/* True if return thunk function with the BND prefix is needed. */
|
||||
+static bool indirect_return_bnd_needed = false;
|
||||
+
|
||||
/* True if return thunk function via CX is needed. */
|
||||
static bool indirect_return_via_cx;
|
||||
/* True if return thunk function via CX with the BND prefix is
|
||||
@@ -11226,16 +11230,18 @@ output_indirect_thunk (bool need_bnd_p, unsigned int regno)
|
||||
/* Output a funtion with a call and return thunk for indirect branch.
|
||||
If BND_P is true, the BND prefix is needed. If REGNO != INVALID_REGNUM,
|
||||
the function address is in REGNO. Otherwise, the function address is
|
||||
- on the top of stack. */
|
||||
+ on the top of stack. Thunk is used for function return if RET_P is
|
||||
+ true. */
|
||||
|
||||
static void
|
||||
-output_indirect_thunk_function (bool need_bnd_p, unsigned int regno)
|
||||
+output_indirect_thunk_function (bool need_bnd_p, unsigned int regno,
|
||||
+ bool ret_p)
|
||||
{
|
||||
char name[32];
|
||||
tree decl;
|
||||
|
||||
/* Create __x86_indirect_thunk/__x86_indirect_thunk_bnd. */
|
||||
- indirect_thunk_name (name, regno, need_bnd_p, false);
|
||||
+ indirect_thunk_name (name, regno, need_bnd_p, ret_p);
|
||||
decl = build_decl (BUILTINS_LOCATION, FUNCTION_DECL,
|
||||
get_identifier (name),
|
||||
build_function_type_list (void_type_node, NULL_TREE));
|
||||
@@ -11278,50 +11284,6 @@ output_indirect_thunk_function (bool need_bnd_p, unsigned int regno)
|
||||
ASM_OUTPUT_LABEL (asm_out_file, name);
|
||||
}
|
||||
|
||||
- /* Create alias for __x86_return_thunk/__x86_return_thunk_bnd or
|
||||
- __x86_return_thunk_ecx/__x86_return_thunk_ecx_bnd. */
|
||||
- bool need_alias;
|
||||
- if (regno == INVALID_REGNUM)
|
||||
- need_alias = true;
|
||||
- else if (regno == CX_REG)
|
||||
- {
|
||||
- if (need_bnd_p)
|
||||
- need_alias = indirect_return_via_cx_bnd;
|
||||
- else
|
||||
- need_alias = indirect_return_via_cx;
|
||||
- }
|
||||
- else
|
||||
- need_alias = false;
|
||||
-
|
||||
- if (need_alias)
|
||||
- {
|
||||
- char alias[32];
|
||||
-
|
||||
- indirect_thunk_name (alias, regno, need_bnd_p, true);
|
||||
-#if TARGET_MACHO
|
||||
- if (TARGET_MACHO)
|
||||
- {
|
||||
- fputs ("\t.weak_definition\t", asm_out_file);
|
||||
- assemble_name (asm_out_file, alias);
|
||||
- fputs ("\n\t.private_extern\t", asm_out_file);
|
||||
- assemble_name (asm_out_file, alias);
|
||||
- putc ('\n', asm_out_file);
|
||||
- ASM_OUTPUT_LABEL (asm_out_file, alias);
|
||||
- }
|
||||
-#else
|
||||
- ASM_OUTPUT_DEF (asm_out_file, alias, name);
|
||||
- if (USE_HIDDEN_LINKONCE)
|
||||
- {
|
||||
- fputs ("\t.globl\t", asm_out_file);
|
||||
- assemble_name (asm_out_file, alias);
|
||||
- putc ('\n', asm_out_file);
|
||||
- fputs ("\t.hidden\t", asm_out_file);
|
||||
- assemble_name (asm_out_file, alias);
|
||||
- putc ('\n', asm_out_file);
|
||||
- }
|
||||
-#endif
|
||||
- }
|
||||
-
|
||||
DECL_INITIAL (decl) = make_node (BLOCK);
|
||||
current_function_decl = decl;
|
||||
allocate_struct_function (decl, false);
|
||||
@@ -11368,19 +11330,29 @@ ix86_code_end (void)
|
||||
rtx xops[2];
|
||||
unsigned int regno;
|
||||
|
||||
+ if (indirect_return_needed)
|
||||
+ output_indirect_thunk_function (false, INVALID_REGNUM, true);
|
||||
+ if (indirect_return_bnd_needed)
|
||||
+ output_indirect_thunk_function (true, INVALID_REGNUM, true);
|
||||
+
|
||||
+ if (indirect_return_via_cx)
|
||||
+ output_indirect_thunk_function (false, CX_REG, true);
|
||||
+ if (indirect_return_via_cx_bnd)
|
||||
+ output_indirect_thunk_function (true, CX_REG, true);
|
||||
+
|
||||
if (indirect_thunk_needed)
|
||||
- output_indirect_thunk_function (false, INVALID_REGNUM);
|
||||
+ output_indirect_thunk_function (false, INVALID_REGNUM, false);
|
||||
if (indirect_thunk_bnd_needed)
|
||||
- output_indirect_thunk_function (true, INVALID_REGNUM);
|
||||
+ output_indirect_thunk_function (true, INVALID_REGNUM, false);
|
||||
|
||||
for (regno = FIRST_REX_INT_REG; regno <= LAST_REX_INT_REG; regno++)
|
||||
{
|
||||
unsigned int i = regno - FIRST_REX_INT_REG + LAST_INT_REG + 1;
|
||||
if ((indirect_thunks_used & (1 << i)))
|
||||
- output_indirect_thunk_function (false, regno);
|
||||
+ output_indirect_thunk_function (false, regno, false);
|
||||
|
||||
if ((indirect_thunks_bnd_used & (1 << i)))
|
||||
- output_indirect_thunk_function (true, regno);
|
||||
+ output_indirect_thunk_function (true, regno, false);
|
||||
}
|
||||
|
||||
for (regno = AX_REG; regno <= SP_REG; regno++)
|
||||
@@ -11389,10 +11361,10 @@ ix86_code_end (void)
|
||||
tree decl;
|
||||
|
||||
if ((indirect_thunks_used & (1 << regno)))
|
||||
- output_indirect_thunk_function (false, regno);
|
||||
+ output_indirect_thunk_function (false, regno, false);
|
||||
|
||||
if ((indirect_thunks_bnd_used & (1 << regno)))
|
||||
- output_indirect_thunk_function (true, regno);
|
||||
+ output_indirect_thunk_function (true, regno, false);
|
||||
|
||||
if (!(pic_labels_used & (1 << regno)))
|
||||
continue;
|
||||
@@ -28077,12 +28049,12 @@ ix86_output_function_return (bool long_p)
|
||||
true);
|
||||
if (need_bnd_p)
|
||||
{
|
||||
- indirect_thunk_bnd_needed |= need_thunk;
|
||||
+ indirect_return_bnd_needed |= need_thunk;
|
||||
fprintf (asm_out_file, "\tbnd jmp\t%s\n", thunk_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
- indirect_thunk_needed |= need_thunk;
|
||||
+ indirect_return_needed |= need_thunk;
|
||||
fprintf (asm_out_file, "\tjmp\t%s\n", thunk_name);
|
||||
}
|
||||
}
|
||||
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c
|
||||
index d2df8b874e0..eee230ca2f6 100644
|
||||
--- a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c
|
||||
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c
|
||||
@@ -13,7 +13,7 @@ foo (void)
|
||||
/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk" } } */
|
||||
/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */
|
||||
/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */
|
||||
-/* { dg-final { scan-assembler "__x86_indirect_thunk:" } } */
|
||||
+/* { dg-final { scan-assembler "__x86_return_thunk:" } } */
|
||||
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?bar" { target *-*-linux* } } } */
|
||||
/* { dg-final { scan-assembler-times {\tpause} 2 } } */
|
||||
/* { dg-final { scan-assembler-times {\tlfence} 2 } } */
|
||||
--
|
||||
2.16.3
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
# DP: Turn on -fstack-protector by default for C, C++, ObjC, ObjC++.
|
||||
# DP: Build libgcc using -fno-stack-protector.
|
||||
|
||||
---
|
||||
gcc/Makefile.in | 2 ++
|
||||
gcc/cp/lang-specs.h | 6 +++---
|
||||
gcc/doc/invoke.texi | 4 ++++
|
||||
gcc/gcc.c | 18 ++++++++++++++----
|
||||
gcc/objc/lang-specs.h | 10 +++++-----
|
||||
gcc/objcp/lang-specs.h | 8 ++++----
|
||||
6 files changed, 32 insertions(+), 16 deletions(-)
|
||||
|
||||
Index: b/gcc/gcc.c
|
||||
===================================================================
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -858,6 +858,14 @@ proper position among the other output f
|
||||
#define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G"
|
||||
#endif
|
||||
|
||||
+#ifndef SSP_DEFAULT_SPEC
|
||||
+#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
+#define SSP_DEFAULT_SPEC "%{!fno-stack-protector:%{!fstack-protector-all:%{!ffreestanding:%{!nostdlib:%{!fstack-protector:-fstack-protector-strong}}}}}"
|
||||
+#else
|
||||
+#define SSP_DEFAULT_SPEC ""
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
#ifndef LINK_SSP_SPEC
|
||||
#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
@@ -1057,6 +1065,7 @@ static const char *cc1_spec = CC1_SPEC;
|
||||
static const char *cc1plus_spec = CC1PLUS_SPEC;
|
||||
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
|
||||
static const char *link_ssp_spec = LINK_SSP_SPEC;
|
||||
+static const char *ssp_default_spec = SSP_DEFAULT_SPEC;
|
||||
static const char *asm_spec = ASM_SPEC;
|
||||
static const char *asm_final_spec = ASM_FINAL_SPEC;
|
||||
static const char *link_spec = LINK_SPEC;
|
||||
@@ -1112,7 +1121,7 @@ static const char *cpp_unique_options =
|
||||
static const char *cpp_options =
|
||||
"%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
|
||||
%{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\
|
||||
- %{undef} %{save-temps*:-fpch-preprocess}";
|
||||
+ %{undef} %{save-temps*:-fpch-preprocess} %(ssp_default)";
|
||||
|
||||
/* This contains cpp options which are not passed when the preprocessor
|
||||
output will be used by another program. */
|
||||
@@ -1301,9 +1310,9 @@ static const struct compiler default_com
|
||||
%{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
|
||||
%(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\
|
||||
cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \
|
||||
- %(cc1_options)}\
|
||||
+ %(cc1_options) %(ssp_default)}\
|
||||
%{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\
|
||||
- cc1 %(cpp_unique_options) %(cc1_options)}}}\
|
||||
+ cc1 %(cpp_unique_options) %(cc1_options) %(ssp_default)}}}\
|
||||
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 1},
|
||||
{"-",
|
||||
"%{!E:%e-E or -x required when input is from standard input}\
|
||||
@@ -1328,7 +1337,7 @@ static const struct compiler default_com
|
||||
%W{o*:--output-pch=%*}}%V}}}}}}}", 0, 0, 0},
|
||||
{".i", "@cpp-output", 0, 0, 0},
|
||||
{"@cpp-output",
|
||||
- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
|
||||
+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %(ssp_default) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
|
||||
{".s", "@assembler", 0, 0, 0},
|
||||
{"@assembler",
|
||||
"%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
|
||||
@@ -1560,6 +1569,7 @@ static struct spec_list static_specs[] =
|
||||
INIT_STATIC_SPEC ("cc1plus", &cc1plus_spec),
|
||||
INIT_STATIC_SPEC ("link_gcc_c_sequence", &link_gcc_c_sequence_spec),
|
||||
INIT_STATIC_SPEC ("link_ssp", &link_ssp_spec),
|
||||
+ INIT_STATIC_SPEC ("ssp_default", &ssp_default_spec),
|
||||
INIT_STATIC_SPEC ("endfile", &endfile_spec),
|
||||
INIT_STATIC_SPEC ("link", &link_spec),
|
||||
INIT_STATIC_SPEC ("lib", &lib_spec),
|
||||
Index: b/gcc/cp/lang-specs.h
|
||||
===================================================================
|
||||
--- a/gcc/cp/lang-specs.h
|
||||
+++ b/gcc/cp/lang-specs.h
|
||||
@@ -46,7 +46,7 @@ along with GCC; see the file COPYING3.
|
||||
%(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\
|
||||
cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\
|
||||
%{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\
|
||||
- %(cc1_options) %2\
|
||||
+ %(cc1_options) %(ssp_default) %2\
|
||||
%{!fsyntax-only:-o %g.s \
|
||||
%{!fdump-ada-spec*:%{!o*:--output-pch=%i.gch}\
|
||||
%W{o*:--output-pch=%*}}%V}}}}",
|
||||
@@ -58,11 +58,11 @@ along with GCC; see the file COPYING3.
|
||||
%(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\
|
||||
cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\
|
||||
%{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\
|
||||
- %(cc1_options) %2\
|
||||
+ %(cc1_options) %(ssp_default) %2\
|
||||
%{!fsyntax-only:%(invoke_as)}}}}",
|
||||
CPLUSPLUS_CPP_SPEC, 0, 0},
|
||||
{".ii", "@c++-cpp-output", 0, 0, 0},
|
||||
{"@c++-cpp-output",
|
||||
"%{!M:%{!MM:%{!E:\
|
||||
- cc1plus -fpreprocessed %i %(cc1_options) %2\
|
||||
+ cc1plus -fpreprocessed %i %(cc1_options) %(ssp_default) %2\
|
||||
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
|
||||
Index: b/gcc/params.def
|
||||
===================================================================
|
||||
--- a/gcc/params.def
|
||||
+++ b/gcc/params.def
|
||||
@@ -673,7 +673,7 @@ DEFPARAM (PARAM_INTEGER_SHARE_LIMIT,
|
||||
DEFPARAM (PARAM_SSP_BUFFER_SIZE,
|
||||
"ssp-buffer-size",
|
||||
"The lower bound for a buffer to be considered for stack smashing protection.",
|
||||
- 8, 1, 0)
|
||||
+ 4, 1, 0)
|
||||
|
||||
DEFPARAM (PARAM_MIN_SIZE_FOR_STACK_SHARING,
|
||||
"min-size-for-stack-sharing",
|
||||
Index: b/gcc/objc/lang-specs.h
|
||||
===================================================================
|
||||
--- a/gcc/objc/lang-specs.h
|
||||
+++ b/gcc/objc/lang-specs.h
|
||||
@@ -29,9 +29,9 @@ along with GCC; see the file COPYING3.
|
||||
%{traditional|traditional-cpp:\
|
||||
%eGNU Objective C no longer supports traditional compilation}\
|
||||
%{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\
|
||||
- cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}\
|
||||
+ cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}}\
|
||||
%{!save-temps*:%{!no-integrated-cpp:\
|
||||
- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\
|
||||
+ cc1obj %(cpp_unique_options) %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}}}\
|
||||
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
|
||||
{"@objective-c-header",
|
||||
"%{E|M|MM:cc1obj -E %{traditional|traditional-cpp:-traditional-cpp}\
|
||||
@@ -40,18 +40,18 @@ along with GCC; see the file COPYING3.
|
||||
%{traditional|traditional-cpp:\
|
||||
%eGNU Objective C no longer supports traditional compilation}\
|
||||
%{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\
|
||||
- cc1obj -fpreprocessed %b.mi %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
|
||||
+ cc1obj -fpreprocessed %b.mi %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\
|
||||
-o %g.s %{!o*:--output-pch=%i.gch}\
|
||||
%W{o*:--output-pch=%*}%V}\
|
||||
%{!save-temps*:%{!no-integrated-cpp:\
|
||||
- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
|
||||
+ cc1obj %(cpp_unique_options) %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\
|
||||
-o %g.s %{!o*:--output-pch=%i.gch}\
|
||||
%W{o*:--output-pch=%*}%V}}}}}", 0, 0, 0},
|
||||
{".mi", "@objective-c-cpp-output", 0, 0, 0},
|
||||
{"@objective-c-cpp-output",
|
||||
- "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
|
||||
+ "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\
|
||||
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
|
||||
{"@objc-cpp-output",
|
||||
"%nobjc-cpp-output is deprecated; please use objective-c-cpp-output instead\n\
|
||||
- %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
|
||||
+ %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\
|
||||
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
|
||||
Index: b/gcc/objcp/lang-specs.h
|
||||
===================================================================
|
||||
--- a/gcc/objcp/lang-specs.h
|
||||
+++ b/gcc/objcp/lang-specs.h
|
||||
@@ -36,7 +36,7 @@ along with GCC; see the file COPYING3.
|
||||
%(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\
|
||||
cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\
|
||||
%{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\
|
||||
- %(cc1_options) %2\
|
||||
+ %(cc1_options) %(ssp_default) %2\
|
||||
-o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}",
|
||||
CPLUSPLUS_CPP_SPEC, 0, 0},
|
||||
{"@objective-c++",
|
||||
@@ -46,16 +46,16 @@ along with GCC; see the file COPYING3.
|
||||
%(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\
|
||||
cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\
|
||||
%{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\
|
||||
- %(cc1_options) %2\
|
||||
+ %(cc1_options) %(ssp_default) %2\
|
||||
%{!fsyntax-only:%(invoke_as)}}}}",
|
||||
CPLUSPLUS_CPP_SPEC, 0, 0},
|
||||
{".mii", "@objective-c++-cpp-output", 0, 0, 0},
|
||||
{"@objective-c++-cpp-output",
|
||||
"%{!M:%{!MM:%{!E:\
|
||||
- cc1objplus -fpreprocessed %i %(cc1_options) %2\
|
||||
+ cc1objplus -fpreprocessed %i %(cc1_options) %(ssp_default) %2\
|
||||
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
|
||||
{"@objc++-cpp-output",
|
||||
"%nobjc++-cpp-output is deprecated; please use objective-c++-cpp-output instead\n\
|
||||
%{!M:%{!MM:%{!E:\
|
||||
- cc1objplus -fpreprocessed %i %(cc1_options) %2\
|
||||
+ cc1objplus -fpreprocessed %i %(cc1_options) %(ssp_default) %2\
|
||||
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
|
||||
Index: b/gcc/doc/invoke.texi
|
||||
===================================================================
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -9247,6 +9247,9 @@
|
||||
The minimum size of variables taking part in stack slot sharing when not
|
||||
optimizing. The default value is 32.
|
||||
|
||||
+The Alpine Linux default is "4", to increase
|
||||
+the number of functions protected by the stack protector.
|
||||
+
|
||||
@item max-jump-thread-duplication-stmts
|
||||
Maximum number of statements allowed in a block that needs to be
|
||||
duplicated when threading jumps.
|
||||
@@ -10185,6 +10188,11 @@
|
||||
Like @option{-fstack-protector} but includes additional functions to
|
||||
be protected --- those that have local array definitions, or have
|
||||
references to local frame addresses.
|
||||
+
|
||||
+NOTE: In Alpine Linux,
|
||||
+@option{-fstack-protector-strong} is enabled by default for C,
|
||||
+C++, ObjC, ObjC++, if none of @option{-fno-stack-protector},
|
||||
+@option{-nostdlib}, nor @option{-ffreestanding} are found.
|
||||
|
||||
@item -fstack-protector-explicit
|
||||
@opindex fstack-protector-explicit
|
||||
@@ -0,0 +1,33 @@
|
||||
# Turn on -Wl,-z,relro,-z,now by default.
|
||||
|
||||
---
|
||||
gcc/doc/invoke.texi | 3 +++
|
||||
gcc/gcc.c | 1 +
|
||||
2 files changed, 4 insertions(+), 0 deletions(-)
|
||||
|
||||
Index: b/gcc/doc/invoke.texi
|
||||
===================================================================
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -11424,6 +11424,9 @@ For example, @option{-Wl,-Map,output.map
|
||||
linker. When using the GNU linker, you can also get the same effect with
|
||||
@option{-Wl,-Map=output.map}.
|
||||
|
||||
+NOTE: In Alpine Linux, for LDFLAGS, the option
|
||||
+@option{-Wl,-z,relro,now} is used. To disable, use @option{-Wl,-z,norelro}.
|
||||
+
|
||||
@item -u @var{symbol}
|
||||
@opindex u
|
||||
Pretend the symbol @var{symbol} is undefined, to force linking of
|
||||
Index: b/gcc/gcc.c
|
||||
===================================================================
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -890,6 +890,7 @@ proper position among the other output f
|
||||
"%{flto|flto=*:%<fcompare-debug*} \
|
||||
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
|
||||
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
|
||||
+ "-z relro -z now " \
|
||||
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
|
||||
%{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
|
||||
@@ -0,0 +1,40 @@
|
||||
# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++,
|
||||
# DP: if the optimization level is > 0
|
||||
|
||||
---
|
||||
gcc/doc/invoke.texi | 6 ++++++
|
||||
gcc/c-family/c-cppbuiltin.c | 3 +
|
||||
2 files changed, 9 insertions(+), 0 deletions(-)
|
||||
|
||||
Index: b/gcc/doc/invoke.texi
|
||||
===================================================================
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -7840,6 +7840,12 @@ also turns on the following optimization
|
||||
Please note the warning under @option{-fgcse} about
|
||||
invoking @option{-O2} on programs that use computed gotos.
|
||||
|
||||
+NOTE: In Alpine Linux, @option{-D_FORTIFY_SOURCE=2} is
|
||||
+set by default, and is activated when @option{-O} is set to 2 or higher.
|
||||
+This enables additional compile-time and run-time checks for several libc
|
||||
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
|
||||
+@option{-D_FORTIFY_SOURCE=0}.
|
||||
+
|
||||
@item -O3
|
||||
@opindex O3
|
||||
Optimize yet more. @option{-O3} turns on all optimizations specified
|
||||
Index: b/gcc/c-family/c-cppbuiltin.c
|
||||
===================================================================
|
||||
--- a/gcc/c-family/c-cppbuiltin.c
|
||||
+++ b/gcc/c-family/c-cppbuiltin.c
|
||||
@@ -1176,6 +1176,10 @@ c_cpp_builtins (cpp_reader *pfile)
|
||||
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
|
||||
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
|
||||
|
||||
+ /* Fortify Source enabled by default for optimization levels > 0 */
|
||||
+ if (optimize)
|
||||
+ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
|
||||
+
|
||||
/* Misc. */
|
||||
if (flag_gnu89_inline)
|
||||
cpp_define (pfile, "__GNUC_GNU_INLINE__");
|
||||
@@ -0,0 +1,241 @@
|
||||
# DP: On linux targets pass --as-needed by default to the linker, but always
|
||||
# DP: link the sanitizer libraries with --no-as-needed.
|
||||
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -568,8 +568,11 @@ proper position among the other output f
|
||||
#ifdef LIBTSAN_EARLY_SPEC
|
||||
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
|
||||
#elif defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
-#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION \
|
||||
- "} -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
|
||||
+ " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
|
||||
+ " -ltsan " \
|
||||
+ " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
|
||||
+ " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
|
||||
STATIC_LIBTSAN_LIBS
|
||||
#else
|
||||
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
|
||||
--- a/gcc/config/gnu-user.h
|
||||
+++ b/gcc/config/gnu-user.h
|
||||
@@ -124,13 +124,13 @@
|
||||
#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
|
||||
"%{static-libasan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
|
||||
- LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
|
||||
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
|
||||
#undef LIBTSAN_EARLY_SPEC
|
||||
#define LIBTSAN_EARLY_SPEC "%{static-libtsan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
|
||||
- LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
|
||||
+ LD_DYNAMIC_OPTION "}}%{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed -ltsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
|
||||
#undef LIBLSAN_EARLY_SPEC
|
||||
#define LIBLSAN_EARLY_SPEC "%{static-liblsan:%{!shared:" \
|
||||
LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \
|
||||
- LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}"
|
||||
+ LD_DYNAMIC_OPTION "}}%{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed -llsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
|
||||
#endif
|
||||
Index: b/gcc/config/aarch64/aarch64-linux.h
|
||||
===================================================================
|
||||
--- a/gcc/config/aarch64/aarch64-linux.h
|
||||
+++ b/gcc/config/aarch64/aarch64-linux.h
|
||||
@@ -36,5 +36,6 @@
|
||||
|
||||
#define LINUX_TARGET_LINK_SPEC "%{h*} \
|
||||
+ --as-needed \
|
||||
%{static:-Bstatic} \
|
||||
%{shared:-shared} \
|
||||
%{symbolic:-Bsymbolic} \
|
||||
Index: b/gcc/config/ia64/linux.h
|
||||
===================================================================
|
||||
--- a/gcc/config/ia64/linux.h
|
||||
+++ b/gcc/config/ia64/linux.h
|
||||
@@ -58,7 +58,7 @@ do { \
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
|
||||
|
||||
#undef LINK_SPEC
|
||||
-#define LINK_SPEC "\
|
||||
+#define LINK_SPEC " --as-needed \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
Index: b/gcc/config/sparc/linux.h
|
||||
===================================================================
|
||||
--- a/gcc/config/sparc/linux.h
|
||||
+++ b/gcc/config/sparc/linux.h
|
||||
@@ -86,7 +86,7 @@ extern const char *host_detect_local_cpu
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
|
||||
#undef LINK_SPEC
|
||||
-#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
|
||||
+#define LINK_SPEC "-m elf32_sparc --as-needed %{shared:-shared} \
|
||||
%{!mno-relax:%{!r:-relax}} \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
Index: b/gcc/config/s390/linux.h
|
||||
===================================================================
|
||||
--- a/gcc/config/s390/linux.h
|
||||
+++ b/gcc/config/s390/linux.h
|
||||
@@ -65,7 +65,7 @@ along with GCC; see the file COPYING3.
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC \
|
||||
- "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
|
||||
+ "%{m31:-m elf_s390}%{m64:-m elf64_s390} --as-needed \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{static:-static} \
|
||||
Index: b/gcc/config/rs6000/linux64.h
|
||||
===================================================================
|
||||
--- a/gcc/config/rs6000/linux64.h
|
||||
+++ b/gcc/config/rs6000/linux64.h
|
||||
@@ -466,12 +466,12 @@ extern int dot_symbols;
|
||||
" -m elf64ppc")
|
||||
#endif
|
||||
|
||||
-#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
|
||||
+#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " --as-needed %{!shared: %{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \
|
||||
%(link_os_extra_spec32)"
|
||||
|
||||
-#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \
|
||||
+#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " --as-needed %{!shared: %{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}} \
|
||||
%(link_os_extra_spec64)"
|
||||
Index: b/gcc/config/rs6000/sysv4.h
|
||||
===================================================================
|
||||
--- a/gcc/config/rs6000/sysv4.h
|
||||
+++ b/gcc/config/rs6000/sysv4.h
|
||||
@@ -784,7 +784,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
|
||||
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
|
||||
MUSL_DYNAMIC_LINKER)
|
||||
|
||||
-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
|
||||
+#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --as-needed %{!shared: %{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
|
||||
|
||||
Index: b/gcc/config/i386/gnu-user64.h
|
||||
===================================================================
|
||||
--- a/gcc/config/i386/gnu-user64.h
|
||||
+++ b/gcc/config/i386/gnu-user64.h
|
||||
@@ -57,5 +57,6 @@ see the files COPYING3 and COPYING.RUNTI
|
||||
%{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
|
||||
%{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
|
||||
+ --as-needed \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
Index: b/gcc/config/i386/gnu-user.h
|
||||
===================================================================
|
||||
--- a/gcc/config/i386/gnu-user.h
|
||||
+++ b/gcc/config/i386/gnu-user.h
|
||||
@@ -74,7 +74,7 @@ along with GCC; see the file COPYING3.
|
||||
{ "link_emulation", GNU_USER_LINK_EMULATION },\
|
||||
{ "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
|
||||
|
||||
-#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
|
||||
+#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) --as-needed %{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
Index: b/gcc/config/alpha/linux-elf.h
|
||||
===================================================================
|
||||
--- a/gcc/config/alpha/linux-elf.h
|
||||
+++ b/gcc/config/alpha/linux-elf.h
|
||||
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3.
|
||||
|
||||
#define ELF_DYNAMIC_LINKER GNU_USER_DYNAMIC_LINKER
|
||||
|
||||
-#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
|
||||
+#define LINK_SPEC "-m elf64alpha --as-needed %{G*} %{relax:-relax} \
|
||||
%{O*:-O3} %{!O*:-O1} \
|
||||
%{shared:-shared} \
|
||||
%{!shared: \
|
||||
Index: b/gcc/config/arm/linux-elf.h
|
||||
===================================================================
|
||||
--- a/gcc/config/arm/linux-elf.h
|
||||
+++ b/gcc/config/arm/linux-elf.h
|
||||
@@ -73,5 +73,6 @@
|
||||
%{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
|
||||
-X \
|
||||
+ --as-needed \
|
||||
%{mbig-endian:-EB} %{mlittle-endian:-EL}" \
|
||||
SUBTARGET_EXTRA_LINK_SPEC
|
||||
|
||||
Index: b/gcc/config/mips/gnu-user.h
|
||||
===================================================================
|
||||
--- a/gcc/config/mips/gnu-user.h
|
||||
+++ b/gcc/config/mips/gnu-user.h
|
||||
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3.
|
||||
#undef GNU_USER_TARGET_LINK_SPEC
|
||||
#define GNU_USER_TARGET_LINK_SPEC "\
|
||||
%{G*} %{EB} %{EL} %{mips*} %{shared} \
|
||||
+ -as-needed \
|
||||
%{!shared: \
|
||||
%{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
Index: b/libjava/Makefile.am
|
||||
===================================================================
|
||||
--- a/libjava/Makefile.am
|
||||
+++ b/libjava/Makefile.am
|
||||
@@ -627,14 +631,14 @@
|
||||
rm .libs/libgcj_bc.so; \
|
||||
mv .libs/libgcj_bc.so.1.0.0 .libs/libgcj_bc.so; \
|
||||
$(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
|
||||
- -o .libs/libgcj_bc.so.1.0.0 -lgcj || exit; \
|
||||
+ -o .libs/libgcj_bc.so.1.0.0 -Wl,--no-as-needed -lgcj || exit; \
|
||||
rm .libs/libgcj_bc.so.1; \
|
||||
$(LN_S) libgcj_bc.so.1.0.0 .libs/libgcj_bc.so.1
|
||||
|
||||
## This rule creates the libgcj_bc library that is actually installed.
|
||||
install/libgcj_bc.la: $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_DEPENDENCIES) install/$(am__dirstamp)
|
||||
$(libgcj_bc_la_LINK) $(am_libgcj_bc_la_rpath) $(libgcj_bc_la_LDFLAGS) \
|
||||
- $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_LIBADD) $(LIBS)
|
||||
+ $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_LIBADD) $(LIBS) -Wl,--no-as-needed -lgcj
|
||||
|
||||
## Note that property_files is defined in sources.am.
|
||||
propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files)))
|
||||
@@ -762,7 +766,7 @@
|
||||
rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
|
||||
mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
|
||||
$(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
|
||||
- -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -lgcj || exit; \
|
||||
+ -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -Wl,--no-as-needed -lgcj || exit; \
|
||||
rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
|
||||
$(LN_S) libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
|
||||
rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.la;
|
||||
|
||||
Index: b/libjava/Makefile.in
|
||||
===================================================================
|
||||
--- a/libjava/Makefile.in
|
||||
+++ b/libjava/Makefile.in
|
||||
@@ -10644,13 +10648,13 @@
|
||||
rm .libs/libgcj_bc.so; \
|
||||
mv .libs/libgcj_bc.so.1.0.0 .libs/libgcj_bc.so; \
|
||||
$(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
|
||||
- -o .libs/libgcj_bc.so.1.0.0 -lgcj || exit; \
|
||||
+ -o .libs/libgcj_bc.so.1.0.0 -Wl,--no-as-needed -lgcj || exit; \
|
||||
rm .libs/libgcj_bc.so.1; \
|
||||
$(LN_S) libgcj_bc.so.1.0.0 .libs/libgcj_bc.so.1
|
||||
|
||||
install/libgcj_bc.la: $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_DEPENDENCIES) install/$(am__dirstamp)
|
||||
$(libgcj_bc_la_LINK) $(am_libgcj_bc_la_rpath) $(libgcj_bc_la_LDFLAGS) \
|
||||
- $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_LIBADD) $(LIBS)
|
||||
+ $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_LIBADD) $(LIBS) -Wl,--no-as-needed -lgcj
|
||||
|
||||
$(propertyo_files): %.lo: classpath/resource/%
|
||||
$(mkinstalldirs) `dirname $@`; \
|
||||
@@ -12494,7 +12498,7 @@
|
||||
@USE_LIBGCJ_BC_TRUE@ rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
|
||||
@USE_LIBGCJ_BC_TRUE@ mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
|
||||
@USE_LIBGCJ_BC_TRUE@ $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
|
||||
-@USE_LIBGCJ_BC_TRUE@ -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -lgcj || exit; \
|
||||
+@USE_LIBGCJ_BC_TRUE@ -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -Wl,--no-as-needed -lgcj || exit; \
|
||||
@USE_LIBGCJ_BC_TRUE@ rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
|
||||
@USE_LIBGCJ_BC_TRUE@ $(LN_S) libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
|
||||
@USE_LIBGCJ_BC_TRUE@ rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.la;
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
Enable -Wformat and -Wformat-security by default.
|
||||
|
||||
|
||||
--- a/gcc/c-family/c.opt
|
||||
+++ b/gcc/c-family/c.opt
|
||||
@@ -412,7 +412,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonliteral) Warning LangEnabledBy(C ObjC C++ O
|
||||
Warn about format strings that are not literals
|
||||
|
||||
Wformat-security
|
||||
-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
|
||||
+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
|
||||
Warn about possible security problems with format functions
|
||||
|
||||
Wformat-y2k
|
||||
@@ -424,7 +424,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
|
||||
Warn about zero-length formats
|
||||
|
||||
Wformat=
|
||||
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0)
|
||||
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0)
|
||||
Warn about printf/scanf/strftime/strfmon format string anomalies
|
||||
|
||||
Wignored-qualifiers
|
||||
--- a/gcc/doc/gcc.info
|
||||
+++ b/gcc/doc/gcc.info
|
||||
@@ -3451,6 +3451,8 @@ compiler warns that an unrecognized option is present.
|
||||
'-Wno-format-contains-nul', '-Wno-format-extra-args', and
|
||||
'-Wno-format-zero-length'. '-Wformat' is enabled by '-Wall'.
|
||||
|
||||
+ This option is enabled by default in Alpine Linux.
|
||||
+
|
||||
'-Wno-format-contains-nul'
|
||||
If '-Wformat' is specified, do not warn about format strings
|
||||
that contain NUL bytes.
|
||||
@@ -3496,6 +3498,8 @@ compiler warns that an unrecognized option is present.
|
||||
future warnings may be added to '-Wformat-security' that are
|
||||
not included in '-Wformat-nonliteral'.)
|
||||
|
||||
+ This option is enabled by default in Alpine Linux.
|
||||
+
|
||||
'-Wformat-y2k'
|
||||
If '-Wformat' is specified, also warn about 'strftime' formats
|
||||
that may yield only a two-digit year.
|
||||
@@ -0,0 +1,25 @@
|
||||
Enable -Wtrampolines by default.
|
||||
|
||||
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -648,7 +648,7 @@ Common Var(warn_system_headers) Warning
|
||||
Do not suppress warnings from system headers
|
||||
|
||||
Wtrampolines
|
||||
-Common Var(warn_trampolines) Warning
|
||||
+Common Var(warn_trampolines) Init(1) Warning
|
||||
Warn whenever a trampoline is generated
|
||||
|
||||
Wtype-limits
|
||||
--- a/gcc/doc/gcc.info
|
||||
+++ b/gcc/doc/gcc.info
|
||||
@@ -4021,6 +4021,8 @@ compiler warns that an unrecognized option is present.
|
||||
and thus requires the stack to be made executable in order for the
|
||||
program to work properly.
|
||||
|
||||
+ This warning is enabled by default in Gentoo.
|
||||
+
|
||||
'-Wfloat-equal'
|
||||
Warn if floating-point values are used in equality comparisons.
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
Ensure that msgfmt doesn't encounter problems during gcc bootstrapping.
|
||||
|
||||
Solves error messages like the following:
|
||||
|
||||
msgfmt: /var/tmp/portage/sys-devel/gcc-4.1.2/work/build/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6)
|
||||
|
||||
The libgcc_s.so used during build doesn't satisfy the needs of the
|
||||
libstdc++.so that msgfmt is linked against. On the other hand, msgfmt
|
||||
is used as a stand-alone application here, and what library it uses
|
||||
behind the scenes is of no concern to the gcc build process.
|
||||
Therefore, simply invoking it "as usual", i.e. without any special
|
||||
library path, will make it work as expected here.
|
||||
|
||||
2011-09-19 Martin von Gagern
|
||||
|
||||
References:
|
||||
https://bugs.gentoo.org/372377
|
||||
https://bugs.gentoo.org/295480
|
||||
|
||||
--- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.am
|
||||
+++ gcc-4.1.2/libstdc++-v3/po/Makefile.am
|
||||
@@ -39,6 +39,7 @@ MSGFMT = msgfmt
|
||||
EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN)
|
||||
|
||||
.po.mo:
|
||||
+ env --unset=LD_LIBRARY_PATH \
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
all-local: all-local-$(USE_NLS)
|
||||
--- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.in
|
||||
+++ gcc-4.1.2/libstdc++-v3/po/Makefile.in
|
||||
@@ -419,6 +419,7 @@ uninstall-am: uninstall-info-am
|
||||
|
||||
|
||||
.po.mo:
|
||||
+ env --unset=LD_LIBRARY_PATH \
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
all-local: all-local-$(USE_NLS)
|
||||
@@ -0,0 +1,18 @@
|
||||
2008-07-25 Magnus Granberg <zorry@ume.nu>
|
||||
|
||||
* include/libiberty.h (asprintf): Don't declare if defined as a macro
|
||||
|
||||
--- a/include/libiberty.h
|
||||
+++ b/include/libiberty.h
|
||||
@@ -609,8 +609,11 @@ extern int pwait (int, int *, int);
|
||||
/* Like sprintf but provides a pointer to malloc'd storage, which must
|
||||
be freed by the caller. */
|
||||
|
||||
+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
|
||||
+#ifndef asprintf
|
||||
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#if !HAVE_DECL_VASPRINTF
|
||||
/* Like vsprintf but provides a pointer to malloc'd storage, which
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/libiberty/Makefile.in
|
||||
+++ b/libiberty/Makefile.in
|
||||
@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
|
||||
$(AR) $(AR_FLAGS) $(TARGETLIB) \
|
||||
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
|
||||
$(RANLIB) $(TARGETLIB); \
|
||||
+ cp $(TARGETLIB) ../ ; \
|
||||
cd ..; \
|
||||
else true; fi
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
https://bugs.gentoo.org/508852
|
||||
https://gcc.gnu.org/PR61164
|
||||
|
||||
2014-04-27 Magnus Granberg <zorry@gentoo.org>
|
||||
|
||||
#508852
|
||||
* libitm/configure.tgt: Disable FORTIFY
|
||||
|
||||
--- a/libitm/configure.tgt
|
||||
+++ b/libitm/configure.tgt
|
||||
@@ -43,6 +43,16 @@ if test "$gcc_cv_have_tls" = yes ; then
|
||||
esac
|
||||
fi
|
||||
|
||||
+# FIXME: error: inlining failed in call to always_inline
|
||||
+# ‘int vfprintf(FILE*, const char*, __va_list_tag*)’
|
||||
+# : function body can be overwritten at link time
|
||||
+# Disable Fortify in libitm for now. #508852
|
||||
+case "${target}" in
|
||||
+ *-*-linux*)
|
||||
+ XCFLAGS="${XCFLAGS} -U_FORTIFY_SOURCE"
|
||||
+ ;;
|
||||
+esac
|
||||
+
|
||||
# Map the target cpu to an ARCH sub-directory. At the same time,
|
||||
# work out any special compilation flags as necessary.
|
||||
case "${target_cpu}" in
|
||||
@@ -0,0 +1,194 @@
|
||||
http://cgit.openembedded.org/openembedded-core/plain/meta/recipes-devtools/gcc/gcc-6.1/0010-gcc-poison-system-directories.patch
|
||||
|
||||
From d76250323dad69212c958e4857a98d99ab51a39e Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 29 Mar 2013 08:59:00 +0400
|
||||
Subject: [PATCH 10/46] gcc: poison-system-directories
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
Upstream-Status: Inappropriate [distribution: codesourcery]
|
||||
---
|
||||
gcc/common.opt | 4 ++++
|
||||
gcc/config.in | 6 ++++++
|
||||
gcc/configure | 16 ++++++++++++++++
|
||||
gcc/configure.ac | 10 ++++++++++
|
||||
gcc/doc/invoke.texi | 9 +++++++++
|
||||
gcc/gcc.c | 2 ++
|
||||
gcc/incpath.c | 19 +++++++++++++++++++
|
||||
7 files changed, 66 insertions(+)
|
||||
|
||||
diff --git a/gcc/common.opt b/gcc/common.opt
|
||||
index 67048db..733185c 100644
|
||||
--- a/gcc/common.opt
|
||||
+++ b/gcc/common.opt
|
||||
@@ -659,6 +659,10 @@ Wreturn-local-addr
|
||||
Common Var(warn_return_local_addr) Init(1) Warning
|
||||
Warn about returning a pointer/reference to a local or temporary variable.
|
||||
|
||||
+Wpoison-system-directories
|
||||
+Common Var(flag_poison_system_directories) Init(1) Warning
|
||||
+Warn for -I and -L options using system directories if cross compiling
|
||||
+
|
||||
Wshadow
|
||||
Common Var(warn_shadow) Warning
|
||||
Warn when one local variable shadows another.
|
||||
diff --git a/gcc/config.in b/gcc/config.in
|
||||
index 115cb61..105b30f 100644
|
||||
--- a/gcc/config.in
|
||||
+++ b/gcc/config.in
|
||||
@@ -187,6 +187,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
+/* Define to warn for use of native system header directories */
|
||||
+#ifndef USED_FOR_TARGET
|
||||
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/* Define if you want all operations on RTL (the basic data structure of the
|
||||
optimizer and back end) to be checked for dynamic type safety at runtime.
|
||||
This is quite expensive. */
|
||||
diff --git a/gcc/configure b/gcc/configure
|
||||
index 1c6e340..8f83152 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -942,6 +942,7 @@ with_system_zlib
|
||||
enable_maintainer_mode
|
||||
enable_link_mutex
|
||||
enable_version_specific_runtime_libs
|
||||
+enable_poison_system_directories
|
||||
enable_plugin
|
||||
enable_host_shared
|
||||
enable_libquadmath_support
|
||||
@@ -1681,6 +1682,8 @@ Optional Features:
|
||||
--enable-version-specific-runtime-libs
|
||||
specify that runtime libraries should be installed
|
||||
in a compiler-specific directory
|
||||
+ --enable-poison-system-directories
|
||||
+ warn for use of native system header directories
|
||||
--enable-plugin enable plugin support
|
||||
--enable-host-shared build host code as shared libraries
|
||||
--disable-libquadmath-support
|
||||
@@ -28908,6 +28911,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
|
||||
fi
|
||||
|
||||
|
||||
+# Check whether --enable-poison-system-directories was given.
|
||||
+if test "${enable_poison_system_directories+set}" = set; then :
|
||||
+ enableval=$enable_poison_system_directories;
|
||||
+else
|
||||
+ enable_poison_system_directories=no
|
||||
+fi
|
||||
+
|
||||
+if test "x${enable_poison_system_directories}" = "xyes"; then
|
||||
+
|
||||
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
|
||||
+
|
||||
+fi
|
||||
+
|
||||
# Substitute configuration variables
|
||||
|
||||
|
||||
diff --git a/gcc/configure.ac b/gcc/configure.ac
|
||||
index 6c1dcd9..0fccaef 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -5861,6 +5861,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
|
||||
[specify that runtime libraries should be
|
||||
installed in a compiler-specific directory])])
|
||||
|
||||
+AC_ARG_ENABLE([poison-system-directories],
|
||||
+ AS_HELP_STRING([--enable-poison-system-directories],
|
||||
+ [warn for use of native system header directories]),,
|
||||
+ [enable_poison_system_directories=no])
|
||||
+if test "x${enable_poison_system_directories}" = "xyes"; then
|
||||
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
|
||||
+ [1],
|
||||
+ [Define to warn for use of native system header directories])
|
||||
+fi
|
||||
+
|
||||
# Substitute configuration variables
|
||||
AC_SUBST(subdirs)
|
||||
AC_SUBST(srcdir)
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index 821f8fd..8bb49e7 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -284,6 +284,7 @@ Objective-C and Objective-C++ Dialects}.
|
||||
-Wparentheses -Wno-pedantic-ms-format @gol
|
||||
-Wplacement-new -Wplacement-new=@var{n} @gol
|
||||
-Wpointer-arith -Wno-pointer-to-int-cast @gol
|
||||
+-Wno-poison-system-directories @gol
|
||||
-Wno-pragmas -Wredundant-decls -Wno-return-local-addr @gol
|
||||
-Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar @gol
|
||||
-Wshift-overflow -Wshift-overflow=@var{n} @gol
|
||||
@@ -4723,6 +4724,14 @@ made up of data only and thus requires no special treatment. But, for
|
||||
most targets, it is made up of code and thus requires the stack to be
|
||||
made executable in order for the program to work properly.
|
||||
|
||||
+@item -Wno-poison-system-directories
|
||||
+@opindex Wno-poison-system-directories
|
||||
+Do not warn for @option{-I} or @option{-L} options using system
|
||||
+directories such as @file{/usr/include} when cross compiling. This
|
||||
+option is intended for use in chroot environments when such
|
||||
+directories contain the correct headers and libraries for the target
|
||||
+system rather than the host.
|
||||
+
|
||||
@item -Wfloat-equal
|
||||
@opindex Wfloat-equal
|
||||
@opindex Wno-float-equal
|
||||
diff --git a/gcc/gcc.c b/gcc/gcc.c
|
||||
index 1af5920..4cfef7f 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -1017,6 +1017,8 @@ proper position among the other output files. */
|
||||
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
|
||||
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} \
|
||||
+ %{Wno-poison-system-directories:--no-poison-system-directories} \
|
||||
+ %{Werror=poison-system-directories:--error-poison-system-directories} \
|
||||
%{static:} %{L*} %(mfwrap) %(link_libgcc) " \
|
||||
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o " CHKP_SPEC " \
|
||||
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
|
||||
diff --git a/gcc/incpath.c b/gcc/incpath.c
|
||||
index ea40f4a..856da41 100644
|
||||
--- a/gcc/incpath.c
|
||||
+++ b/gcc/incpath.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "intl.h"
|
||||
#include "incpath.h"
|
||||
#include "cppdefault.h"
|
||||
+#include "diagnostic-core.h"
|
||||
|
||||
/* Microsoft Windows does not natively support inodes.
|
||||
VMS has non-numeric inodes. */
|
||||
@@ -381,6 +382,24 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
|
||||
}
|
||||
fprintf (stderr, _("End of search list.\n"));
|
||||
}
|
||||
+
|
||||
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
|
||||
+ if (flag_poison_system_directories)
|
||||
+ {
|
||||
+ struct cpp_dir *p;
|
||||
+
|
||||
+ for (p = heads[QUOTE]; p; p = p->next)
|
||||
+ {
|
||||
+ if ((!strncmp (p->name, "/usr/include", 12))
|
||||
+ || (!strncmp (p->name, "/usr/local/include", 18))
|
||||
+ || (!strncmp (p->name, "/usr/X11R6/include", 18)))
|
||||
+ warning (OPT_Wpoison_system_directories,
|
||||
+ "include location \"%s\" is unsafe for "
|
||||
+ "cross-compilation",
|
||||
+ p->name);
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Use given -I paths for #include "..." but not #include <...>, and
|
||||
--
|
||||
2.8.2
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
libatomic build failure if configured with --disable-dependency-tracking
|
||||
load_n.c:115:1: fatal error: opening dependency file .deps/load_1_.lo.Ppo: No such file or directory
|
||||
|
||||
https://bugs.gentoo.org/463463
|
||||
http://gcc.gnu.org/PR55930
|
||||
|
||||
--- a/libatomic/Makefile.in
|
||||
+++ b/libatomic/Makefile.in
|
||||
@@ -298,7 +298,8 @@ PAT_N = $(word 2,$(PAT_SPLIT))
|
||||
PAT_S = $(word 3,$(PAT_SPLIT))
|
||||
IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
|
||||
IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
|
||||
-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
|
||||
+@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
|
||||
+@AMDEP_FALSE@M_DEPS =
|
||||
M_SIZE = -DN=$(PAT_N)
|
||||
M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
|
||||
M_FILE = $(PAT_BASE)_n.c
|
||||
@@ -0,0 +1,59 @@
|
||||
From 594e3c1ab576daddeb86015efc8b1677020b1878 Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Sat, 24 Oct 2015 20:39:30 +0000
|
||||
Subject: [PATCH 1/6] cilkrts
|
||||
|
||||
---
|
||||
libcilkrts/runtime/os-unix.c | 22 +++++++---------------
|
||||
1 file changed, 7 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/libcilkrts/runtime/os-unix.c b/libcilkrts/runtime/os-unix.c
|
||||
index cb582dd..e43d7d5 100644
|
||||
--- a/libcilkrts/runtime/os-unix.c
|
||||
+++ b/libcilkrts/runtime/os-unix.c
|
||||
@@ -51,6 +51,7 @@
|
||||
#if defined __linux__
|
||||
# include <sys/sysinfo.h>
|
||||
# include <sys/syscall.h>
|
||||
+# include <sched.h>
|
||||
#elif defined __APPLE__
|
||||
# include <sys/sysctl.h>
|
||||
// Uses sysconf(_SC_NPROCESSORS_ONLN) in verbose output
|
||||
@@ -400,28 +401,19 @@ COMMON_SYSDEP void __cilkrts_sleep(void)
|
||||
|
||||
COMMON_SYSDEP void __cilkrts_yield(void)
|
||||
{
|
||||
-#if __APPLE__ || __FreeBSD__ || __VXWORKS__
|
||||
- // On MacOS, call sched_yield to yield quantum. I'm not sure why we
|
||||
- // don't do this on Linux also.
|
||||
- sched_yield();
|
||||
-#elif defined(__DragonFly__)
|
||||
- // On DragonFly BSD, call sched_yield to yield quantum.
|
||||
- sched_yield();
|
||||
-#elif defined(__MIC__)
|
||||
+#if defined(__MIC__)
|
||||
// On MIC, pthread_yield() really trashes things. Arch's measurements
|
||||
// showed that calling _mm_delay_32() (or doing nothing) was a better
|
||||
// option. Delaying 1024 clock cycles is a reasonable compromise between
|
||||
// giving up the processor and latency starting up when work becomes
|
||||
// available
|
||||
_mm_delay_32(1024);
|
||||
-#elif defined(__ANDROID__) || (defined(__sun__) && defined(__svr4__))
|
||||
- // On Android and Solaris, call sched_yield to yield quantum. I'm not
|
||||
- // sure why we don't do this on Linux also.
|
||||
- sched_yield();
|
||||
-#else
|
||||
- // On Linux, call pthread_yield (which in turn will call sched_yield)
|
||||
- // to yield quantum.
|
||||
+#elif defined(__sun__) && !defined(__svr4__)
|
||||
+ // On old SunOS call pthread_yield to yield a quantum.
|
||||
pthread_yield();
|
||||
+#else
|
||||
+ // On other platforms call sched_yield to yield a quantum.
|
||||
+ sched_yield();
|
||||
#endif
|
||||
}
|
||||
|
||||
--
|
||||
2.8.1
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
From 9e3eab51e518018d9d99b3123598b1e2322a6af3 Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Sat, 24 Oct 2015 20:09:53 +0000
|
||||
Subject: [PATCH 3/6] libgcc_s
|
||||
|
||||
---
|
||||
gcc/config/i386/i386.c | 4 ++--
|
||||
libgcc/config/i386/cpuinfo.c | 6 +++---
|
||||
libgcc/config/i386/t-linux | 2 +-
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index 3d044e8..82523e1 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -40269,10 +40269,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
|
||||
{
|
||||
case IX86_BUILTIN_CPU_INIT:
|
||||
{
|
||||
- /* Make it call __cpu_indicator_init in libgcc. */
|
||||
+ /* Make it call __cpu_indicator_init_local in libgcc.a. */
|
||||
tree call_expr, fndecl, type;
|
||||
type = build_function_type_list (integer_type_node, NULL_TREE);
|
||||
- fndecl = build_fn_decl ("__cpu_indicator_init", type);
|
||||
+ fndecl = build_fn_decl ("__cpu_indicator_init_local", type);
|
||||
call_expr = build_call_expr (fndecl, 0);
|
||||
return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
|
||||
}
|
||||
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
|
||||
index 8c2248d..6c82f15 100644
|
||||
--- a/libgcc/config/i386/cpuinfo.c
|
||||
+++ b/libgcc/config/i386/cpuinfo.c
|
||||
@@ -485,7 +485,7 @@ __cpu_indicator_init (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-#if defined SHARED && defined USE_ELF_SYMVER
|
||||
-__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0");
|
||||
-__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0");
|
||||
+#ifndef SHARED
|
||||
+int __cpu_indicator_init_local (void)
|
||||
+ __attribute__ ((weak, alias ("__cpu_indicator_init")));
|
||||
#endif
|
||||
diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux
|
||||
index 11bb46e..4f47f7b 100644
|
||||
--- a/libgcc/config/i386/t-linux
|
||||
+++ b/libgcc/config/i386/t-linux
|
||||
@@ -3,4 +3,4 @@
|
||||
# t-slibgcc-elf-ver and t-linux
|
||||
SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver
|
||||
|
||||
-HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER
|
||||
+HOST_LIBGCC2_CFLAGS += -mlong-double-80
|
||||
--
|
||||
2.8.1
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From edec78452d693fb524daa9a6efd45c850b27b25c Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Fri, 6 Nov 2015 23:59:20 +0000
|
||||
Subject: [PATCH 4/6] linux_libc_has_function
|
||||
|
||||
---
|
||||
gcc/config/linux.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gcc/config/linux.c b/gcc/config/linux.c
|
||||
index 250296b..16c3768 100644
|
||||
--- a/gcc/config/linux.c
|
||||
+++ b/gcc/config/linux.c
|
||||
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
bool
|
||||
linux_libc_has_function (enum function_class fn_class)
|
||||
{
|
||||
- if (OPTION_GLIBC)
|
||||
+ if (OPTION_GLIBC || OPTION_MUSL)
|
||||
return true;
|
||||
if (OPTION_BIONIC)
|
||||
if (fn_class == function_c94
|
||||
--
|
||||
2.8.1
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
From b6015aca9c9cc83739fd0ed637a835119b2c4e34 Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <nsz@port70.net>
|
||||
Date: Sat, 7 Nov 2015 02:08:05 +0000
|
||||
Subject: [PATCH 5/6] nopie
|
||||
|
||||
---
|
||||
gcc/configure | 27 +++++++++++++++++++++++++++
|
||||
gcc/configure.ac | 13 +++++++++++++
|
||||
2 files changed, 40 insertions(+)
|
||||
|
||||
diff --git a/gcc/configure b/gcc/configure
|
||||
index 1c6e340..7e8b5d6 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -29390,6 +29390,33 @@ fi
|
||||
$as_echo "$gcc_cv_no_pie" >&6; }
|
||||
if test "$gcc_cv_no_pie" = "yes"; then
|
||||
NO_PIE_FLAG="-no-pie"
|
||||
+else
|
||||
+ # Check if -nopie works.
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -nopie option" >&5
|
||||
+$as_echo_n "checking for -nopie option... " >&6; }
|
||||
+if test "${gcc_cv_nopie+set}" = set; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ saved_LDFLAGS="$LDFLAGS"
|
||||
+ LDFLAGS="$LDFLAGS -nopie"
|
||||
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+int main(void) {return 0;}
|
||||
+_ACEOF
|
||||
+if ac_fn_cxx_try_link "$LINENO"; then :
|
||||
+ gcc_cv_nopie=yes
|
||||
+else
|
||||
+ gcc_cv_nopie=no
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+ LDFLAGS="$saved_LDFLAGS"
|
||||
+fi
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_nopie" >&5
|
||||
+$as_echo "$gcc_cv_nopie" >&6; }
|
||||
+ if test "$gcc_cv_nopie" = "yes"; then
|
||||
+ NO_PIE_FLAG="-nopie"
|
||||
+ fi
|
||||
fi
|
||||
|
||||
|
||||
diff --git a/gcc/configure.ac b/gcc/configure.ac
|
||||
index 6c1dcd9..0ca7647 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -6098,6 +6098,19 @@ AC_CACHE_CHECK([for -no-pie option],
|
||||
LDFLAGS="$saved_LDFLAGS"])
|
||||
if test "$gcc_cv_no_pie" = "yes"; then
|
||||
NO_PIE_FLAG="-no-pie"
|
||||
+else
|
||||
+ # Check if -nopie works.
|
||||
+ AC_CACHE_CHECK([for -nopie option],
|
||||
+ [gcc_cv_nopie],
|
||||
+ [saved_LDFLAGS="$LDFLAGS"
|
||||
+ LDFLAGS="$LDFLAGS -nopie"
|
||||
+ AC_LINK_IFELSE([int main(void) {return 0;}],
|
||||
+ [gcc_cv_nopie=yes],
|
||||
+ [gcc_cv_nopie=no])
|
||||
+ LDFLAGS="$saved_LDFLAGS"])
|
||||
+ if test "$gcc_cv_nopie" = "yes"; then
|
||||
+ NO_PIE_FLAG="-nopie"
|
||||
+ fi
|
||||
fi
|
||||
AC_SUBST([NO_PIE_FLAG])
|
||||
|
||||
--
|
||||
2.8.1
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
|
||||
index b0bf40a..d4b56fe 100644
|
||||
--- a/gcc/config/gnu-user.h
|
||||
+++ b/gcc/config/gnu-user.h
|
||||
@@ -51,10 +51,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#if defined HAVE_LD_PIE
|
||||
#define GNU_USER_TARGET_STARTFILE_SPEC \
|
||||
"%{!shared: %{pg|p|profile:gcrt1.o%s;: \
|
||||
- %{" PIE_SPEC ":Scrt1.o%s} %{" NO_PIE_SPEC ":crt1.o%s}}} \
|
||||
- crti.o%s %{static:crtbeginT.o%s;: %{shared:crtbeginS.o%s} \
|
||||
+ %{" PIE_SPEC ":%{static:rcrt1.o%s;:Scrt1.o%s}} %{" NO_PIE_SPEC ":crt1.o%s}}} \
|
||||
+ crti.o%s %{shared:crtbeginS.o%s;: \
|
||||
%{" PIE_SPEC ":crtbeginS.o%s} \
|
||||
- %{" NO_PIE_SPEC ":crtbegin.o%s}} \
|
||||
+ %{" NO_PIE_SPEC ":%{static:crtbeginT.o%s;:crtbegin.o%s}}} \
|
||||
%{fvtable-verify=none:%s; \
|
||||
fvtable-verify=preinit:vtv_start_preinit.o%s; \
|
||||
fvtable-verify=std:vtv_start.o%s} \
|
||||
diff --git a/gcc/gcc.c b/gcc/gcc.c
|
||||
index 0208d61..731564e 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -870,7 +870,7 @@ proper position among the other output files. */
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DEFAULT_PIE
|
||||
-#define NO_PIE_SPEC "no-pie|static"
|
||||
+#define NO_PIE_SPEC "no-pie"
|
||||
#define PIE_SPEC NO_PIE_SPEC "|r|shared:;"
|
||||
#define NO_FPIE1_SPEC "fno-pie"
|
||||
#define FPIE1_SPEC NO_FPIE1_SPEC ":;"
|
||||
@@ -916,7 +916,7 @@ proper position among the other output files. */
|
||||
#ifndef LINK_PIE_SPEC
|
||||
#ifdef HAVE_LD_PIE
|
||||
#ifndef LD_PIE_SPEC
|
||||
-#define LD_PIE_SPEC "-pie"
|
||||
+#define LD_PIE_SPEC "-pie %{static:--no-dynamic-linker -Bsymbolic}"
|
||||
#endif
|
||||
#else
|
||||
#define LD_PIE_SPEC ""
|
||||
@@ -0,0 +1,32 @@
|
||||
From be841c16dd544553c67faac79bd4cc3cd10a1dc0 Mon Sep 17 00:00:00 2001
|
||||
From: "Tuan M. Hoang" <tmhoang@flatglobe.org>
|
||||
Date: Mon, 21 Nov 2016 01:42:16 +0700
|
||||
Subject: [PATCH] main/gcc: add musl s390x dynamic linker
|
||||
|
||||
---
|
||||
gcc/config/s390/linux.h | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
|
||||
index 1e3ed35..a244214 100644
|
||||
--- a/gcc/config/s390/linux.h
|
||||
+++ b/gcc/config/s390/linux.h
|
||||
@@ -63,6 +63,15 @@ along with GCC; see the file COPYING3. If not see
|
||||
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
|
||||
#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
|
||||
|
||||
+#undef MUSL_DYNAMIC_LINKER
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-s390x.so.1"
|
||||
+#undef MUSL_DYNAMIC_LINKER32
|
||||
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-s390x.so.1"
|
||||
+#undef MUSL_DYNAMIC_LINKER64
|
||||
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-s390x.so.1"
|
||||
+#undef MUSL_DYNAMIC_LINKERX32
|
||||
+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-s390x.so.1"
|
||||
+
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC \
|
||||
"%{m31:-m elf_s390}%{m64:-m elf64_s390} --as-needed \
|
||||
--
|
||||
2.10.2
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From 697a7ba791fce2ffab2ed723d909a89684019e3d Mon Sep 17 00:00:00 2001
|
||||
From: "Tuan M. Hoang" <tmhoang@flatglobe.org>
|
||||
Date: Sun, 19 Feb 2017 17:03:33 +0000
|
||||
Subject: [PATCH] main/gcc : when building gcc-java on s390x, libgcj.so
|
||||
complains about undefined reference to __data_start. Using
|
||||
SEARCH_FOR_DATA_START instead solved it. Credit to Andrew Haley at RedHat.
|
||||
|
||||
---
|
||||
boehm-gc/include/private/gcconfig.h | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h
|
||||
index 4ca6a80..a15fff6 100644
|
||||
--- a/boehm-gc/include/private/gcconfig.h
|
||||
+++ b/boehm-gc/include/private/gcconfig.h
|
||||
@@ -1837,8 +1837,7 @@
|
||||
# define OS_TYPE "LINUX"
|
||||
# define LINUX_STACKBOTTOM
|
||||
# define DYNAMIC_LOADING
|
||||
- extern int __data_start[];
|
||||
-# define DATASTART ((ptr_t)(__data_start))
|
||||
+# define SEARCH_FOR_DATA_START
|
||||
extern int _end[];
|
||||
# define DATAEND (_end)
|
||||
# define CACHE_LINE_SIZE 256
|
||||
--
|
||||
2.11.1
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
diff --git a/libffi/closures.c.orig b/libffi/closures.c
|
||||
index 721ff00..22a699c 100644
|
||||
--- a/libffi/src/closures.c.orig
|
||||
+++ b/libffi/src/closures.c
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <ffi_common.h>
|
||||
|
||||
#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
|
||||
-# if __gnu_linux__ && !defined(__ANDROID__)
|
||||
+# if __linux__ && !defined(__ANDROID__)
|
||||
/* This macro indicates it may be forbidden to map anonymous memory
|
||||
with both write and execute permission. Code compiled when this
|
||||
option is defined will attempt to map such pages once, but if it
|
||||
@@ -0,0 +1,717 @@
|
||||
# Automatically generated aport, do not edit!
|
||||
# Generator: pmbootstrap aportgen gcc-aarch64
|
||||
# Based on: main/gcc
|
||||
|
||||
CTARGET_ARCH=aarch64
|
||||
CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})"
|
||||
LANG_OBJC=false
|
||||
LANG_JAVA=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LANG_ADA=false
|
||||
options="!strip !tracedeps"
|
||||
|
||||
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
|
||||
# when this variable matches "no*"
|
||||
BOOTSTRAP="nobuildbase"
|
||||
|
||||
# abuild will only cross compile when this variable is set, but it
|
||||
# needs to find a valid package database in there for dependency
|
||||
# resolving, so we set it to /.
|
||||
CBUILDROOT="/"
|
||||
|
||||
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
|
||||
|
||||
pkgname="gcc-aarch64"
|
||||
pkgver=6.4.0
|
||||
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
|
||||
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
|
||||
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
|
||||
|
||||
pkgname="gcc-aarch64"
|
||||
pkgrel=8
|
||||
pkgdesc="Stage2 cross-compiler for aarch64"
|
||||
url="http://gcc.gnu.org"
|
||||
arch="armhf x86_64 x86"
|
||||
license="GPL LGPL"
|
||||
_gccrel=$pkgver-r$pkgrel
|
||||
depends="isl binutils-aarch64"
|
||||
makedepends_build="gcc g++ paxmark bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
|
||||
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-aarch64 binutils-aarch64"
|
||||
subpackages="g++-aarch64:gpp"
|
||||
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target"
|
||||
replaces="libstdc++ binutils"
|
||||
|
||||
: ${LANG_CXX:=true}
|
||||
: ${LANG_OBJC:=true}
|
||||
: ${LANG_JAVA:=true}
|
||||
: ${LANG_GO:=true}
|
||||
: ${LANG_FORTRAN:=true}
|
||||
: ${LANG_ADA:=true}
|
||||
|
||||
LIBGOMP="false"
|
||||
LIBGCC="false"
|
||||
LIBATOMIC="false"
|
||||
LIBITM="false"
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
if [ "$BOOTSTRAP" = nolibc ]; then
|
||||
LANG_CXX=false
|
||||
LANG_ADA=false
|
||||
LIBGCC=false
|
||||
_builddir="$srcdir/build-cross-pass2"
|
||||
else
|
||||
_builddir="$srcdir/build-cross-final"
|
||||
fi
|
||||
LANG_OBJC=false
|
||||
LANG_JAVA=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
LIBGOMP=false
|
||||
LIBATOMIC=false
|
||||
LIBITM=false
|
||||
|
||||
# reset target flags (should be set in crosscreate abuild)
|
||||
# fixup flags. seems gcc treats CPPFLAGS as global without
|
||||
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
|
||||
export CFLAGS="$CPPFLAGS $CFLAGS"
|
||||
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
||||
unset CPPFLAGS
|
||||
export CFLAGS_FOR_TARGET=" "
|
||||
export CXXFLAGS_FOR_TARGET=" "
|
||||
export LDFLAGS_FOR_TARGET=" "
|
||||
|
||||
STRIP_FOR_TARGET="$CTARGET-strip"
|
||||
elif [ "$CBUILD" != "$CHOST" ]; then
|
||||
# fixup flags. seems gcc treats CPPFLAGS as global without
|
||||
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
|
||||
export CFLAGS="$CPPFLAGS $CFLAGS"
|
||||
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
||||
unset CPPFLAGS
|
||||
|
||||
# reset flags and cc for build
|
||||
export CC_FOR_BUILD="gcc"
|
||||
export CXX_FOR_BUILD="g++"
|
||||
export CFLAGS_FOR_BUILD=" "
|
||||
export CXXFLAGS_FOR_BUILD=" "
|
||||
export LDFLAGS_FOR_BUILD=" "
|
||||
export CFLAGS_FOR_TARGET=" "
|
||||
export CXXFLAGS_FOR_TARGET=" "
|
||||
export LDFLAGS_FOR_TARGET=" "
|
||||
|
||||
# Languages that do not need bootstrapping
|
||||
LANG_OBJC=false
|
||||
LANG_JAVA=false
|
||||
LANG_GO=false
|
||||
LANG_FORTRAN=false
|
||||
|
||||
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
||||
_builddir="$srcdir/build-cross-native"
|
||||
else
|
||||
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
|
||||
_builddir="$srcdir/build"
|
||||
fi
|
||||
|
||||
# Go needs {set,make,swap}context, unimplemented in musl
|
||||
[ "$CTARGET_LIBC" = musl ] && LANG_GO=false
|
||||
|
||||
# libitm has TEXTRELs in ARM build, so disable for now
|
||||
case "$CTARGET_ARCH" in
|
||||
arm*) LIBITM=false ;;
|
||||
mips*) LIBITM=false ;;
|
||||
esac
|
||||
|
||||
# Fortran uses libquadmath if toolchain has __float128
|
||||
# currently on x86, x86_64 and ia64
|
||||
LIBQUADMATH=$LANG_FORTRAN
|
||||
case "$CTARGET_ARCH" in
|
||||
x86 | x86_64) LIBQUADMATH=$LANG_FORTRAN ;;
|
||||
*) LIBQUADMATH=false ;;
|
||||
esac
|
||||
|
||||
# libatomic is a dependency for openvswitch
|
||||
$LIBATOMIC && subpackages="$subpackages libatomic::$CTARGET_ARCH"
|
||||
$LIBGCC && subpackages="$subpackages libgcc::$CTARGET_ARCH"
|
||||
$LIBQUADMATH && subpackages="$subpackages libquadmath::$CTARGET_ARCH"
|
||||
if $LIBGOMP; then
|
||||
depends="$depends libgomp=$_gccrel"
|
||||
subpackages="$subpackages libgomp::$CTARGET_ARCH"
|
||||
fi
|
||||
|
||||
_languages=c
|
||||
if $LANG_CXX; then
|
||||
_languages="$_languages,c++"
|
||||
fi
|
||||
if $LANG_OBJC; then
|
||||
subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc"
|
||||
_languages="$_languages,objc"
|
||||
fi
|
||||
if $LANG_JAVA; then
|
||||
subpackages="$subpackages libgcj::$CTARGET_ARCH gcc-java$_target:java"
|
||||
_languages="$_languages,java"
|
||||
fi
|
||||
if $LANG_GO; then
|
||||
subpackages="$subpackages libgo::$CTARGET_ARCH gcc-go$_target:go"
|
||||
_languages="$_languages,go"
|
||||
fi
|
||||
if $LANG_FORTRAN; then
|
||||
subpackages="$subpackages libgfortran::$CTARGET_ARCH gfortran$_target:gfortran"
|
||||
_languages="$_languages,fortran"
|
||||
fi
|
||||
if $LANG_ADA; then
|
||||
subpackages="$subpackages libgnat::$CTARGET_ARCH gcc-gnat$_target:gnat"
|
||||
_languages="$_languages,ada"
|
||||
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
|
||||
fi
|
||||
makedepends="$makedepends_build $makedepends_host"
|
||||
|
||||
source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
|
||||
http://sourceware.org/pub/java/ecj-4.9.jar
|
||||
|
||||
001_all_default-ssp-strong.patch
|
||||
002_all_default-relro.patch
|
||||
003_all_default-fortify-source.patch
|
||||
005_all_default-as-needed.patch
|
||||
011_all_default-warn-format-security.patch
|
||||
012_all_default-warn-trampolines.patch
|
||||
020_all_msgfmt-libstdc++-link.patch
|
||||
050_all_libiberty-asprintf.patch
|
||||
051_all_libiberty-pic.patch
|
||||
053_all_libitm-no-fortify-source.patch
|
||||
067_all_gcc-poison-system-directories.patch
|
||||
090_all_pr55930-dependency-tracking.patch
|
||||
|
||||
201-cilkrts.patch
|
||||
203-libgcc_s.patch
|
||||
204-linux_libc_has_function.patch
|
||||
205-nopie.patch
|
||||
207-static-pie.patch
|
||||
|
||||
libgcc-always-build-gcceh.a.patch
|
||||
gcc-4.9-musl-fortify.patch
|
||||
gcc-6.1-musl-libssp.patch
|
||||
boehm-gc-musl.patch
|
||||
gcc-pure64.patch
|
||||
fix-gcj-stdgnu14-link.patch
|
||||
fix-gcj-musl.patch
|
||||
fix-gcj-iconv-musl.patch
|
||||
|
||||
gcc-4.8-build-args.patch
|
||||
fix-cxxflags-passing.patch
|
||||
ada-fixes.patch
|
||||
ada-shared.patch
|
||||
ada-musl.patch
|
||||
ada-aarch64-multiarch.patch
|
||||
|
||||
300-main-gcc-add-musl-s390x-dynamic-linker.patch
|
||||
310-build-gcj-s390x.patch
|
||||
320-libffi-gnulinux.patch
|
||||
|
||||
fix-rs6000-pie.patch
|
||||
fix-linux-header-use-in-libgcc.patch
|
||||
gcc-pure64-mips.patch
|
||||
ada-mips64.patch
|
||||
|
||||
0001-i386-Move-struct-ix86_frame-to-machine_function.patch
|
||||
0002-i386-Use-reference-of-struct-ix86_frame-to-avoid-cop.patch
|
||||
0003-i386-Use-const-reference-of-struct-ix86_frame-to-avo.patch
|
||||
0004-x86-Add-mindirect-branch.patch
|
||||
0005-x86-Add-mfunction-return.patch
|
||||
0006-x86-Add-mindirect-branch-register.patch
|
||||
0007-x86-Add-V-register-operand-modifier.patch
|
||||
0008-x86-Disallow-mindirect-branch-mfunction-return-with-.patch
|
||||
0009-Use-INVALID_REGNUM-in-indirect-thunk-processing.patch
|
||||
0010-i386-Pass-INVALID_REGNUM-as-invalid-register-number.patch
|
||||
0011-i386-Update-mfunction-return-for-return-with-pop.patch
|
||||
0012-i386-Add-TARGET_INDIRECT_BRANCH_REGISTER.patch
|
||||
0013-i386-Don-t-generate-alias-for-function-return-thunk.patch
|
||||
"
|
||||
|
||||
# we build out-of-tree
|
||||
_gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver}
|
||||
_gcclibdir=/usr/lib/gcc/${CTARGET}/$pkgver
|
||||
_gcclibexec=/usr/libexec/gcc/${CTARGET}/$pkgver
|
||||
|
||||
prepare() {
|
||||
cd "$_gccdir"
|
||||
|
||||
_err=
|
||||
for i in $source; do
|
||||
case "$i" in
|
||||
*.patch)
|
||||
msg "Applying $i"
|
||||
patch -p1 -F3 -i "$srcdir"/$i || _err="$_err $i"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$_err" ]; then
|
||||
error "The following patches failed:"
|
||||
for i in $_err; do
|
||||
echo " $i"
|
||||
done
|
||||
return 1
|
||||
fi
|
||||
|
||||
# see http://gcc.gnu.org/ml/java/2008-04/msg00027.html
|
||||
mv "$srcdir"/ecj-*.jar ecj.jar
|
||||
|
||||
echo ${pkgver} > gcc/BASE-VER
|
||||
}
|
||||
|
||||
build() {
|
||||
local _arch_configure=
|
||||
local _libc_configure=
|
||||
local _bootstrap_configure=
|
||||
local _symvers=
|
||||
|
||||
cd "$_gccdir"
|
||||
|
||||
case "$CTARGET" in
|
||||
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
|
||||
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
|
||||
armv6-*-*-*eabihf) _arch_configure="--with-arch=armv6zk --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-abi=aapcs-linux";;
|
||||
armv7-*-*-*eabihf) _arch_configure="--with-arch=armv7-a --with-tune=generic-armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-abi=aapcs-linux --with-mode=thumb";;
|
||||
mips-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
|
||||
mips64-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
|
||||
mips64el-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";;
|
||||
mipsel-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";;
|
||||
powerpc-*-*-*) _arch_configure="--enable-secureplt --enable-decimal-float=no";;
|
||||
powerpc64*-*-*-*) _arch_configure="--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no --enable-targets=powerpcle-linux";;
|
||||
i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";;
|
||||
i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";;
|
||||
s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";;
|
||||
esac
|
||||
|
||||
case "$CTARGET_ARCH" in
|
||||
mips*) _hash_style_configure="--with-linker-hash-style=sysv" ;;
|
||||
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
|
||||
esac
|
||||
|
||||
case "$CTARGET_LIBC" in
|
||||
musl)
|
||||
# musl does not support mudflap, or libsanitizer
|
||||
# libmpx uses secure_getenv and struct _libc_fpstate not present in musl
|
||||
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
|
||||
_libc_configure="--disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer"
|
||||
_symvers="--disable-symvers"
|
||||
export libat_cv_have_ifunc=no
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
case "$BOOTSTRAP" in
|
||||
nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;;
|
||||
*) _bootstrap_configure="--enable-shared --enable-threads --enable-tls" ;;
|
||||
esac
|
||||
|
||||
$LIBGOMP || _bootstrap_configure="$_bootstrap_configure --disable-libgomp"
|
||||
$LIBATOMIC || _bootstrap_configure="$_bootstrap_configure --disable-libatomic"
|
||||
$LIBITM || _bootstrap_configure="$_bootstrap_configure --disable-libitm"
|
||||
$LIBQUADMATH || _arch_configure="$_arch_configure --disable-libquadmath"
|
||||
|
||||
msg "Building the following:"
|
||||
echo ""
|
||||
echo " CBUILD=$CBUILD"
|
||||
echo " CHOST=$CHOST"
|
||||
echo " CTARGET=$CTARGET"
|
||||
echo " CTARGET_ARCH=$CTARGET_ARCH"
|
||||
echo " CTARGET_LIBC=$CTARGET_LIBC"
|
||||
echo " languages=$_languages"
|
||||
echo " arch_configure=$_arch_configure"
|
||||
echo " libc_configure=$_libc_configure"
|
||||
echo " cross_configure=$_cross_configure"
|
||||
echo " bootstrap_configure=$_bootstrap_configure"
|
||||
echo " hash_style_configure=$_hash_style_configure"
|
||||
echo ""
|
||||
|
||||
mkdir -p "$_builddir"
|
||||
cd "$_builddir"
|
||||
"$_gccdir"/configure --prefix=/usr \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--build=${CBUILD} \
|
||||
--host=${CHOST} \
|
||||
--target=${CTARGET} \
|
||||
--with-pkgversion="Alpine ${pkgver}" \
|
||||
--enable-checking=release \
|
||||
--disable-fixed-point \
|
||||
--disable-libstdcxx-pch \
|
||||
--disable-multilib \
|
||||
--disable-nls \
|
||||
--disable-werror \
|
||||
$_symvers \
|
||||
--enable-__cxa_atexit \
|
||||
--enable-default-pie \
|
||||
--enable-cloog-backend \
|
||||
--enable-languages=$_languages \
|
||||
$_arch_configure \
|
||||
$_libc_configure \
|
||||
$_cross_configure \
|
||||
$_bootstrap_configure \
|
||||
--with-system-zlib \
|
||||
$_hash_style_configure
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$_builddir"
|
||||
make -j1 DESTDIR="${pkgdir}" install
|
||||
|
||||
ln -s gcc "$pkgdir"/usr/bin/cc
|
||||
|
||||
# we dont support gcj -static
|
||||
# and saving 35MB is not bad.
|
||||
find "$pkgdir" -name libgcj.a -o -name libgtkpeer.a \
|
||||
-o -name libgjsmalsa.a -o -name libgcj-tools.a \
|
||||
-o -name libjvm.a -o -name libgij.a -o -name libgcj_bc.a \
|
||||
-o -name libjavamath.a \
|
||||
| xargs rm -f
|
||||
|
||||
# strip debug info from some static libs
|
||||
${STRIP_FOR_TARGET} -g `find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
|
||||
-o -name libmudflap.a -o -name libmudflapth.a \
|
||||
-o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \
|
||||
-o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \
|
||||
-o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \
|
||||
-a -type f`
|
||||
|
||||
if $LANG_JAVA; then
|
||||
sed -i -e 's/lib: /&%{static:%eJava programs cannot be linked statically}/' \
|
||||
"$pkgdir"/usr/lib/libgcj.spec
|
||||
fi
|
||||
|
||||
if $LIBGOMP; then
|
||||
mv "$pkgdir"/usr/lib/libgomp.spec "$pkgdir"/$_gcclibdir
|
||||
fi
|
||||
if $LIBITM; then
|
||||
mv "$pkgdir"/usr/lib/libitm.spec "$pkgdir"/$_gcclibdir
|
||||
fi
|
||||
|
||||
# remove ffi
|
||||
rm -f "$pkgdir"/usr/lib/libffi* "$pkgdir"/usr/share/man/man3/ffi*
|
||||
find "$pkgdir" -name 'ffi*.h' | xargs rm -f
|
||||
|
||||
local gdblib=${_target:+$CTARGET/}lib
|
||||
for i in $(find "$pkgdir"/usr/$gdblib/ -type f -maxdepth 1 -name "*-gdb.py" ); do
|
||||
mkdir -p "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib
|
||||
mv "$i" "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib/
|
||||
done
|
||||
|
||||
paxmark -pmrs "$pkgdir"/$_gcclibexec/cc1
|
||||
|
||||
# move ada runtime libs
|
||||
if $LANG_ADA; then
|
||||
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.so"); do
|
||||
mv "$i" "$pkgdir"/usr/lib/
|
||||
ln -s ../../../../${i##*/} $i
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$CHOST" != "$CTARGET" ]; then
|
||||
# cross-gcc: remove any files that would conflict with the
|
||||
# native gcc package
|
||||
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "$pkgdir"/usr/share
|
||||
# libcc1 does not depend on target, don't ship it
|
||||
rm -rf "$pkgdir"/usr/lib/libcc1.so*
|
||||
|
||||
# fixup gcc library symlinks to be linker scripts so
|
||||
# linker finds the libs from relocated sysroot
|
||||
for so in "$pkgdir"/usr/$CTARGET/lib/*.so; do
|
||||
if [ -h "$so" ]; then
|
||||
local _real=$(basename $(readlink "$so"))
|
||||
rm -f "$so"
|
||||
echo "GROUP ($_real)" > "$so"
|
||||
fi
|
||||
done
|
||||
else
|
||||
# add c89/c99 wrapper scripts
|
||||
cat >"$pkgdir"/usr/bin/c89 <<'EOF'
|
||||
#!/bin/sh
|
||||
fl="-std=c89"
|
||||
for opt; do
|
||||
case "$opt" in
|
||||
-ansi|-std=c89|-std=iso9899:1990) fl="";;
|
||||
-std=*) echo "$(basename $0) called with non ANSI/ISO C option $opt" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
exec gcc $fl ${1+"$@"}
|
||||
EOF
|
||||
cat >"$pkgdir"/usr/bin/c99 <<'EOF'
|
||||
#!/bin/sh
|
||||
fl="-std=c99"
|
||||
for opt; do
|
||||
case "$opt" in
|
||||
-std=c99|-std=iso9899:1999) fl="";;
|
||||
-std=*) echo "$(basename $0) called with non ISO C99 option $opt" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
exec gcc $fl ${1+"$@"}
|
||||
EOF
|
||||
chmod 755 "$pkgdir"/usr/bin/c?9
|
||||
fi
|
||||
}
|
||||
|
||||
libatomic() {
|
||||
pkgdesc="GCC Atomic library"
|
||||
depends=
|
||||
replaces="gcc"
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libatomic.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libcxx() {
|
||||
pkgdesc="GNU C++ standard runtime library"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gpp() {
|
||||
pkgdesc="GNU C++ standard library and compiler"
|
||||
depends="libstdc++=$_gccrel gcc=$_gccrel libc-dev"
|
||||
mkdir -p "$subpkgdir/$_gcclibexec" \
|
||||
"$subpkgdir"/usr/bin \
|
||||
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
|
||||
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
|
||||
|
||||
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
|
||||
paxmark -pmrs "$subpkgdir/$_gcclibexec/cc1plus"
|
||||
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/*++* "$subpkgdir"/usr/${_target:+$CTARGET/}lib/
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}include/c++ "$subpkgdir"/usr/${_target:+$CTARGET/}include/
|
||||
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
|
||||
}
|
||||
|
||||
libobjc() {
|
||||
pkgdesc="GNU Objective-C runtime"
|
||||
replaces="objc"
|
||||
depends=
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libobjc.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
objc() {
|
||||
pkgdesc="GNU Objective-C"
|
||||
replaces="gcc"
|
||||
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_gcclibdir/include \
|
||||
"$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
|
||||
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
|
||||
"$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libgcc() {
|
||||
pkgdesc="GNU C compiler runtime libraries"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgcc_s.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libgomp() {
|
||||
pkgdesc="GCC shared-memory parallel programming API library"
|
||||
depends=
|
||||
replaces="gcc"
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
java() {
|
||||
pkgdesc="Java support for GCC"
|
||||
depends="zlib-dev gcc=$_gccrel libgcj=$_gccrel"
|
||||
|
||||
paxmark -pm "$pkgdir"/$_gcclibexec/ecj1
|
||||
mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib "$subpkgdir"/$_gcclibdir/
|
||||
cd "$pkgdir"/usr/bin
|
||||
mv gcj gcj-dbtool gjavah gcjh jcf-dump "$subpkgdir"/usr/bin/
|
||||
cd "$pkgdir"
|
||||
for i in $(find usr/ -name ecj1 -o -name jc1 -o -name jvgenmain); do
|
||||
mkdir -p "$subpkgdir"/${i%/*}
|
||||
mv "$pkgdir"/$i "$subpkgdir"/$i
|
||||
done
|
||||
for i in "$pkgdir"/usr/lib/libgcj*.so; do
|
||||
if [ -L "$i" ]; then
|
||||
mv "$i" "$subpkgdir"/usr/lib/
|
||||
fi
|
||||
done
|
||||
mv "$pkgdir"/usr/lib/libgij.so "$subpkgdir"/usr/lib/
|
||||
mv "$pkgdir"/usr/lib/libgcj.spec "$subpkgdir"/$_gcclibdir/
|
||||
}
|
||||
|
||||
libgcj() {
|
||||
pkgdesc="Java runtime library for gcc"
|
||||
# libgcj_bc.so moved from gcc-java to libgcj
|
||||
replaces="gcc-java"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/bin
|
||||
cd "$pkgdir"/usr/bin
|
||||
paxmark -pmse "$pkgdir"/usr/bin/gij
|
||||
mv aot-compile gappletviewer gc-analyze gij gjar gjarsigner gkeytool\
|
||||
gnative2ascii gorbd grmic grmid grmiregistry gserialver \
|
||||
gtnameserv jv-convert rebuild-gcj-db \
|
||||
"$subpkgdir"/usr/bin/
|
||||
cd "$pkgdir"
|
||||
for i in $(find usr/lib -name jc1 -o -name jvgenmain); do
|
||||
mkdir -p "$subpkgdir"/${i%/*}
|
||||
mv "$pkgdir"/$i "$subpkgdir"/$i
|
||||
done
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/gcj-* \
|
||||
"$pkgdir"/usr/lib/libgcj_bc.so \
|
||||
"$pkgdir"/usr/lib/libgcj*.so.* \
|
||||
"$pkgdir"/usr/lib/libgij.so.* \
|
||||
"$pkgdir"/usr/lib/logging.properties \
|
||||
"$pkgdir"/usr/lib/security \
|
||||
"$subpkgdir"/usr/lib/
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/share/
|
||||
mv "$pkgdir"/usr/share/java "$subpkgdir"/usr/share/
|
||||
}
|
||||
|
||||
libgo() {
|
||||
pkgdesc="Go runtime library for GCC"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libgo.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
go() {
|
||||
pkgdesc="Go support for GCC"
|
||||
depends="gcc=$_gccrel libgo=$_gccrel"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||
"$subpkgdir"/usr/lib \
|
||||
"$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
|
||||
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
|
||||
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
|
||||
mv "$pkgdir"/usr/lib/libgo.a \
|
||||
"$pkgdir"/usr/lib/libgo.so \
|
||||
"$pkgdir"/usr/lib/libgobegin.a \
|
||||
"$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libgfortran() {
|
||||
pkgdesc="Fortran runtime library for GCC"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libgfortran.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
libquadmath() {
|
||||
replaces="gcc"
|
||||
pkgdesc="128-bit math library for GCC"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libquadmath.so.* "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gfortran() {
|
||||
pkgdesc="GNU Fortran Compiler"
|
||||
depends="gcc=$_gccrel libgfortran=$_gccrel"
|
||||
$LIBQUADMATH && depends="$depends libquadmath=$_gccrel"
|
||||
replaces="gcc"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||
"$subpkgdir"/$_gcclibdir \
|
||||
"$subpkgdir"/usr/lib \
|
||||
"$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/usr/bin/*gfortran "$subpkgdir"/usr/bin/
|
||||
mv "$pkgdir"/usr/lib/libgfortran.a \
|
||||
"$pkgdir"/usr/lib/libgfortran.so \
|
||||
"$subpkgdir"/usr/lib/
|
||||
if $LIBQUADMATH; then
|
||||
mv "$pkgdir"/usr/lib/libquadmath.a \
|
||||
"$pkgdir"/usr/lib/libquadmath.so \
|
||||
"$subpkgdir"/usr/lib/
|
||||
fi
|
||||
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
|
||||
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
|
||||
}
|
||||
|
||||
libgnat() {
|
||||
pkgdesc="GNU Ada runtime shared libraries"
|
||||
depends=
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/lib
|
||||
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
|
||||
}
|
||||
|
||||
gnat() {
|
||||
pkgdesc="Ada support for GCC"
|
||||
depends="gcc=$_gccrel"
|
||||
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
|
||||
|
||||
mkdir -p "$subpkgdir"/$_gcclibexec \
|
||||
"$subpkgdir"/$_gcclibdir \
|
||||
"$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/$_gcclibexec/*gnat* "$subpkgdir"/$_gcclibexec/
|
||||
mv "$pkgdir"/$_gcclibdir/*ada* "$subpkgdir"/$_gcclibdir/
|
||||
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
|
||||
}
|
||||
|
||||
sha512sums="02c60e54527c7adf584798d5251f8a0b80c93d5deafce82501b2c28e6692e0bd783927bbfc4bc527a863c0cccc025150a34740a9e29badb02d4b48e56a8aba90 gcc-6.4.0.tar.xz
|
||||
28f8c6fdbcb19e950b1d0bafb3bcc7a8cba87bc673aa6027cece116599cdee80f0cf5e95a1440544890239f5c754e8a93ab46d9daedd937faef445d7ea33b226 ecj-4.9.jar
|
||||
a1335adc2fbee98e36c4437ff2587771b98ed4180726779020f65039498235626a411cdb0100dbd20cd19d12f0d94f9a21af179ff624676c28cead9d60598b5d 001_all_default-ssp-strong.patch
|
||||
e36e95b81489163abd6fe9d58f7867bdca43e61143afacbfb17f4698c0b16ec5fd0061d8fab7b2ae615540bebd721c2e2227f80401b4e7fc253da9da62e6b513 002_all_default-relro.patch
|
||||
f86466c62b8291fac46f9c250c7ad8fa5ab7b1cce2504442fd07ddc4543665b317ae28951f244e39aba29aeaf3fff252ec4f6a147aa16adb2b7aed747dd89188 003_all_default-fortify-source.patch
|
||||
51282fea54c7e616367bbeb2479ba13fec6f24eb47bd04e2071907b3b36273b2ff24676f46ef8d22f241c8ab4857307861eee076eab66797c3a50a8ecaa1809a 005_all_default-as-needed.patch
|
||||
3398386dd1e079d6545dd9799adc799c6b80e3984fac6899d0e1a7ee21b66d0c7e53cddf17a65d590c883db750f9f79aaedd857355a8b9f7fb9476c906237919 011_all_default-warn-format-security.patch
|
||||
9adb0d2b9b67dd957df6c609b8714c7c078efb52cd88770905c37c67827be8fc83d1125037b9c29d77db21ce78756aa2bb0bacdb0b98d869ac126da76a298e21 012_all_default-warn-trampolines.patch
|
||||
d35a3ac7e13a4446921a90e1ff3eec1079840c845f9d523c868e24ae21f94cf69ba041de5341ebef96432a6f57598e223381d4286e8fb8baaa25906707f29fbd 020_all_msgfmt-libstdc++-link.patch
|
||||
840070a3c423e6206aaa6e63e1d9a0fcd6efd53626cd1240a193f0b60aa5d84216acc4a2a4fa8bce74549b07e6a316b01d638f20cea13dc62473491a302fb3d6 050_all_libiberty-asprintf.patch
|
||||
0a0bc72b9366158f5d23fff1928e756fdd212433bac6ab1f00d632f241382820db8db5d475ddf11ea020eaf7e2e71b12fb9b1c3c870cf84adf6c2b16f15aabca 051_all_libiberty-pic.patch
|
||||
e7a2eb1b1870e199d6fd753d065781575656fa12baa264f96c5d179689d88c31b8a3f92a5dae96088c05e96aa2bda138364ad7dbcc79e1819a102f192cbb7bab 053_all_libitm-no-fortify-source.patch
|
||||
e87da18aa7ab92b02b06168658c63b42a6c73a08fad2a30f81ef6296100fdbe3c3a91548fd0cb24eaf591e862bb08e4b67249bc4b977b07da33523aee0c686bc 067_all_gcc-poison-system-directories.patch
|
||||
4a328d1e1a56c20166307edcfa322068915784d9c08025b7f81cf69714da48fc266b6d34f77b9135c2f10da830d9df408276a1b78d1fd218637c2823506593c2 090_all_pr55930-dependency-tracking.patch
|
||||
ef052d0c3c9642fcb5ed570069c5a49c8ef523c47ac8ce3f201a801766f72ae4ff7c3725a70ee66e52c0fb559621e35fe0cf5b88b901d71ceadd381f49653a08 201-cilkrts.patch
|
||||
808e206f5e107084156fba333d4e091dcbd62f5d7756142bc292d4b0a52619f8c2aaca3617defc2f5b6552ba0439aebd33f4141329d88eab6ddf2dd637d92c08 203-libgcc_s.patch
|
||||
fc0de05b36613b732a0222ea005c90653c6a40d6761b6894af2419272f4e74875f37e26af33a9b9940669ef89269c44c46d17ca5bcd54b5cd1176e5eaf2992c1 204-linux_libc_has_function.patch
|
||||
98473bcaa77903a223ca9b0d2087c0921b287a2816d308cc32c8fe009e6cbf5dd1ae7fba27794ab8d9c09e117fe534413d91a464d1218474fc123ce0adfdc2c1 205-nopie.patch
|
||||
3287d5b443bea8ec64132bcabe869c738ae98ea8f1a86df1c5d18c927f8816edbfcefeefc47792dbbb2bcacf50319af00e01b3735d34525913b64350770ad453 207-static-pie.patch
|
||||
d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch
|
||||
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
|
||||
dbe0ee917fc7668571722364ab7c806731e3a31e8bfa30b4941b28b16b877d2a32b4a3897ef533399a28f82d43cac9b28e92de0493f0e779046db56584e07fa4 gcc-6.1-musl-libssp.patch
|
||||
bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7 boehm-gc-musl.patch
|
||||
fa62556719449caec6b2b434355bfbcaa5ae55ffe017b3e1f827f66a2aae21b79c571ee7a4ce723ea69169bc3a6447e73650991a200cc372adf2f102677518d7 gcc-pure64.patch
|
||||
2253941f3d19b6d08801d3782f5f5ed56c3b73fbc9d3561a8f01c702963ac4fab91599c686076e7081eb6a80c37ccd33591ae978996d6eee1dc0ce0f1c50259a fix-gcj-stdgnu14-link.patch
|
||||
f89ddeb21bc8f97e6a850a6b70b4501a8f3e49a4bc8cc82897488decda5d98ad01cb7f6c8b392d452e9579924a523bc75da6e0648c1c976d42e40af48b10343b fix-gcj-musl.patch
|
||||
54d67cc008b735e47771314171930c5d8b8f5f5dc97fcf4214824c105c808f3e75d22d5a4fdf5068ed0457fa0d46c60cfb442e276259a4a5e9b8722a027d18e6 fix-gcj-iconv-musl.patch
|
||||
abe9aaf9aa956058d0386a4396a511d176a46bb3906b90e952383646cdc158cbeb0a5dc616a1ccb1ca7d49fd0b5e351532aa15a3b13362abbf1ca4266f54a687 gcc-4.8-build-args.patch
|
||||
35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch
|
||||
9016b257abd8fa981de44a49512e35db814d1cbb47c1a87cd31c12d4ae20b13e9e149fe41691a7ec3c95bbcfde8a79194a8d2eaf547ceade3a246fad67c47dd8 ada-fixes.patch
|
||||
3f5bc334d9f73d06f5f7c876738d02356acdd08958bea0e4d2095ebf15c2c2ec4e411abdae0297505ae9a1699ca01b17338e853184e84663203b192b0d35fc19 ada-shared.patch
|
||||
631d4bdef6d8bde34df7978bb53ec28c3c909cf1f87139e5f148138d0f09adc58b41ecf0148bbf50fb4bc916c411e9bf8a2b6c046c75c0e77d754d8c35bcd4d7 ada-musl.patch
|
||||
fa44c8158111627aa0e91c43e7cc3aa38642c2041c96532dd4f0932dae4d6f92ea2850b683abcf10e7e120299d42ea6b69adc00002a514c76be8e39e99fa052b ada-aarch64-multiarch.patch
|
||||
4b4a0ff306a8ef34ff6e3284fbfca869012164a47ba7cb099085c1dd03e6ca0cdd462f82710e08c9a02895adc7484e4c5eef17b5aa264cf5d978fe8ad78eea93 300-main-gcc-add-musl-s390x-dynamic-linker.patch
|
||||
385bc2fa50204f678964e5148c6170f572701dab920fbec8301f505bda34d182cde0adb7da042fee71719e12fb59f59181897f9b1bb4f4716ff59aad46ca1998 310-build-gcj-s390x.patch
|
||||
f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45b58ba8764ab1eb575d4eb6d6dfc550a87a183f8b94e76181 320-libffi-gnulinux.patch
|
||||
01c71cd5881fc07ea3b9b980697e89b3ca0fe98502958ceafc3fca18b2604c844e2f457feab711baf8e03f00a5383b0e38aac7eb954034e306f43d4a37f165ed fix-rs6000-pie.patch
|
||||
34a818d5be67eb1f34e44a80b83c28a9b9c17d37fc9fac639f490d6bb5b53ebe3318140d09c236a17d7c98f5a7792ae3d6cefccda8067a5e942d6305b9d1f87c fix-linux-header-use-in-libgcc.patch
|
||||
86be3338cc9c33089608bc4c5e3b7918c4e500a345c338f361b18c342119a6ed69af5495d72950de7106d760f003528b46ad14795e805f8a3331e206dcb234e3 gcc-pure64-mips.patch
|
||||
508f3bca214d88531d739d761d07affc953689b1540905c73420b34c246e1e6b72588cf89f0e1462752633f8ddc88da8c0238be2a1b6e1c213829cecee7924cf ada-mips64.patch
|
||||
7912964bf3a985e9f870250d6e068f715582a4fb04270849d697a50e6aad0cf50df3d483ff80a0eb777d9940fd85526dd8d0b85da9bc71a5f2fbc07616263866 0001-i386-Move-struct-ix86_frame-to-machine_function.patch
|
||||
baa27a4b912d8e27cd65a556b09cf45289a0e00e86dae3925f2923d1f3752080e80d80e159c996ef4156c4df1dfc3069114810a846672170ef3ae461ae0ab7e1 0002-i386-Use-reference-of-struct-ix86_frame-to-avoid-cop.patch
|
||||
6701d15000bdd7c4c98a8fece8c814f5e4e73603eecf84fe4dc5ac10f79b3074afba7c2cc9e51d08b2abade1c34cb0c944c08ead7a85db94e97158c752fd1aac 0003-i386-Use-const-reference-of-struct-ix86_frame-to-avo.patch
|
||||
4e7e71ae57e232b29a6455ec977f60b47df1356eca0e85976ae2b4567c4c39541be9f10c30fe0085d69be5acdb61dff51d3e9d7af587c95d9cd2cb9ee307bd13 0004-x86-Add-mindirect-branch.patch
|
||||
07f7fdbd9b4876f36ed7715a35a369dbaf1016f46c42a8935930cfcc9ea250de2dbe8113f077373ccce3c39cd728f957b6c4c7c6a7da299f160a4109f0bbe88d 0005-x86-Add-mfunction-return.patch
|
||||
76ea947591e5241f8e6216ce337baaf1b5dfe3f02d8251f77a4acd70e2a5e7798e2867d70f452027f51a2e3baf1b5c94c3bffe9ef8e0a5ce24dc5d509adaf414 0006-x86-Add-mindirect-branch-register.patch
|
||||
1c33c5cd34efb44d4fa0ace56e3d27ec802a66e03b08a29ab6122cbc70edbbe22313a34114437a41e09e0a6869af3cea3fb18f5bcb49db2f8e3f155026fe15f0 0007-x86-Add-V-register-operand-modifier.patch
|
||||
5366e2cff0629304394bf35e9417c7faea6b6f3fc565d0410a17fdafcb2b30c9a218f8ca098274c09ca4c982ff5b178ad6df5bf464ec541aa086966915c7fe11 0008-x86-Disallow-mindirect-branch-mfunction-return-with-.patch
|
||||
67c738b1f6afb09b6f0469c9cb282ab4d51fc8dd8e39df1cfdff8831788c1022081fccd446a482623f649898733aeaaa205cba0aa41162cdbdc74e57de9bb6eb 0009-Use-INVALID_REGNUM-in-indirect-thunk-processing.patch
|
||||
b7b59f3203bf53168de2170b91738cd456f6ae205b3fe5bf8aacbaa8cc5624dd09c941ad8f1071d1ab8ab4fb5f69068a4bc792c0486fdec1ee2eb9c83688bb78 0010-i386-Pass-INVALID_REGNUM-as-invalid-register-number.patch
|
||||
c53d4c5968865abb709ee8a9af9d57917d43ea3ba31ee8312f9e8f338e9b1b44babf5aa3414848da7267e5cf13a9261815eb9185dc153cbd41ee7ce5ea23d2d0 0011-i386-Update-mfunction-return-for-return-with-pop.patch
|
||||
955080ba3e42cfe2f604e5dcef46aa6fca7c899c7808398947af655ff3b7954e30807ef85246986a5cc7db36dbc870db151e9fa8d8bc967b89ea56efdf64614c 0012-i386-Add-TARGET_INDIRECT_BRANCH_REGISTER.patch
|
||||
3aae3a9cef8e8afe5a5433db8d9f410e1a2882481af01bb1d33232f987dbb74d7780c32be70b868bb391b3601b65ed3a16d777afea946f5eeaff72aa1e7fa3a9 0013-i386-Don-t-generate-alias-for-function-return-thunk.patch"
|
||||
@@ -0,0 +1,16 @@
|
||||
--- gcc-6.4.0/gcc/ada/gcc-interface/Makefile.in.orig
|
||||
+++ gcc-6.4.0/gcc/ada/gcc-interface/Makefile.in
|
||||
@@ -2042,13 +2042,8 @@
|
||||
system.ads<system-linux-x86_64.ads
|
||||
## ^^ Note the above is a pretty-close placeholder.
|
||||
|
||||
- ifneq (,$(or $(filter aarch64-linux-gnu, $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multiarch)), $(filter ../lib64, $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory))))
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
$(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
|
||||
- else
|
||||
- LIBGNAT_TARGET_PAIRS = \
|
||||
- $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
|
||||
- endif
|
||||
|
||||
TOOLS_TARGET_PAIRS = \
|
||||
mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
|
||||
@@ -0,0 +1,35 @@
|
||||
--- gcc-6.1.0.orig/gcc/ada/cal.c
|
||||
+++ gcc-6.1.0/gcc/ada/cal.c
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <time.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
+#include <time.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
--- gcc-6.1.0.orig/gcc/ada/terminals.c
|
||||
+++ gcc-6.1.0/gcc/ada/terminals.c
|
||||
@@ -1068,13 +1068,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
-/* On some system termio is either absent or including it will disable termios
|
||||
- (HP-UX) */
|
||||
-#if !defined (__hpux__) && !defined (BSD) && !defined (__APPLE__) \
|
||||
- && !defined (__rtems__)
|
||||
-# include <termio.h>
|
||||
-#endif
|
||||
-
|
||||
#include <sys/ioctl.h>
|
||||
#include <termios.h>
|
||||
#include <fcntl.h>
|
||||
@@ -1169,7 +1162,7 @@
|
||||
char *slave_name = NULL;
|
||||
|
||||
#ifdef USE_GETPT
|
||||
- master_fd = getpt ();
|
||||
+ master_fd = posix_openpt (O_RDWR);
|
||||
#elif defined (USE_OPENPTY)
|
||||
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
|
||||
#elif defined (USE_CLONE_DEVICE)
|
||||
@@ -0,0 +1,224 @@
|
||||
From 5bbd6ca3755e2a199de98d2b270d8a6f616aa6a6 Mon Sep 17 00:00:00 2001
|
||||
From: Nils Andreas Svee <me@lochnair.net>
|
||||
Date: Thu, 21 Dec 2017 16:46:12 +0100
|
||||
Subject: [PATCH] ada-mips64
|
||||
|
||||
---
|
||||
gcc/ada/gcc-interface/Makefile.in | 29 ++++++--
|
||||
gcc/ada/system-linux-mips64.ads | 147 ++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 171 insertions(+), 5 deletions(-)
|
||||
create mode 100644 gcc/ada/system-linux-mips64.ads
|
||||
|
||||
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
|
||||
index 598b262d9..1844a6962 100644
|
||||
--- a/gcc/ada/gcc-interface/Makefile.in
|
||||
+++ b/gcc/ada/gcc-interface/Makefile.in
|
||||
@@ -1854,9 +1854,9 @@ ifeq ($(strip $(filter-out cygwin% mingw32% pe,$(target_os))),)
|
||||
LIBRARY_VERSION := $(LIB_VERSION)
|
||||
endif
|
||||
|
||||
-# Mips Linux
|
||||
-ifeq ($(strip $(filter-out mips linux%,$(target_cpu) $(target_os))),)
|
||||
- LIBGNAT_TARGET_PAIRS = \
|
||||
+# Mips and Mips64 Linux
|
||||
+ifeq ($(strip $(filter-out mips mips64 linux%,$(target_cpu) $(target_os))),)
|
||||
+ LIBGNAT_TARGET_PAIRS_COMMON = \
|
||||
a-intnam.ads<a-intnam-linux.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
s-intman.adb<s-intman-posix.adb \
|
||||
@@ -1867,10 +1867,29 @@ ifeq ($(strip $(filter-out mips linux%,$(target_cpu) $(target_os))),)
|
||||
s-taprop.adb<s-taprop-linux.adb \
|
||||
s-tasinf.ads<s-tasinf-linux.ads \
|
||||
s-tasinf.adb<s-tasinf-linux.adb \
|
||||
- s-taspri.ads<s-taspri-posix.ads \
|
||||
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
|
||||
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
|
||||
+ g-sercom.adb<g-sercom-linux.adb
|
||||
+
|
||||
+ LIBGNAT_TARGET_PAIRS_32 = \
|
||||
system.ads<system-linux-mips.ads
|
||||
|
||||
+ LIBGNAT_TARGET_PAIRS_64 = \
|
||||
+ system.ads<system-linux-mips64.ads
|
||||
+
|
||||
+ ifeq ($(strip $(filter-out mips64,$(target_cpu))),)
|
||||
+ LIBGNAT_TARGET_PAIRS = \
|
||||
+ $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
|
||||
+ else
|
||||
+ LIBGNAT_TARGET_PAIRS = \
|
||||
+ $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
|
||||
+ endif
|
||||
+
|
||||
+ TOOLS_TARGET_PAIRS = \
|
||||
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
|
||||
+ indepsw.adb<indepsw-gnu.adb
|
||||
+
|
||||
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
|
||||
EH_MECHANISM=-gcc
|
||||
THREADSLIB = -lpthread
|
||||
GNATLIB_SHARED = gnatlib-shared-dual
|
||||
@@ -1901,7 +1920,7 @@ ifeq ($(strip $(filter-out mipsel mips64el linux%,$(target_cpu) $(target_os))),)
|
||||
LIBGNAT_TARGET_PAIRS_64 = \
|
||||
system.ads<system-linux-mips64el.ads
|
||||
|
||||
- ifneq (,$(or $(filter mips64el%, $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multiarch)), $(filter ../lib64, $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory))))
|
||||
+ ifeq ($(strip $(filter-out mips64el,$(target_cpu))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
$(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
|
||||
else
|
||||
diff --git a/gcc/ada/system-linux-mips64.ads b/gcc/ada/system-linux-mips64.ads
|
||||
new file mode 100644
|
||||
index 000000000..054379acd
|
||||
--- /dev/null
|
||||
+++ b/gcc/ada/system-linux-mips64.ads
|
||||
@@ -0,0 +1,147 @@
|
||||
+------------------------------------------------------------------------------
|
||||
+-- --
|
||||
+-- GNAT RUN-TIME COMPONENTS --
|
||||
+-- --
|
||||
+-- S Y S T E M --
|
||||
+-- --
|
||||
+-- S p e c --
|
||||
+-- (GNU-Linux/MIPS64 Version) --
|
||||
+-- --
|
||||
+-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
|
||||
+-- --
|
||||
+-- This specification is derived from the Ada Reference Manual for use with --
|
||||
+-- GNAT. The copyright notice above, and the license provisions that follow --
|
||||
+-- apply solely to the contents of the part following the private keyword. --
|
||||
+-- --
|
||||
+-- GNAT is free software; you can redistribute it and/or modify it under --
|
||||
+-- terms of the GNU General Public License as published by the Free Soft- --
|
||||
+-- ware Foundation; either version 3, or (at your option) any later ver- --
|
||||
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
|
||||
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
|
||||
+-- or FITNESS FOR A PARTICULAR PURPOSE. --
|
||||
+-- --
|
||||
+-- As a special exception under Section 7 of GPL version 3, you are granted --
|
||||
+-- additional permissions described in the GCC Runtime Library Exception, --
|
||||
+-- version 3.1, as published by the Free Software Foundation. --
|
||||
+-- --
|
||||
+-- You should have received a copy of the GNU General Public License and --
|
||||
+-- a copy of the GCC Runtime Library Exception along with this program; --
|
||||
+-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
|
||||
+-- <http://www.gnu.org/licenses/>. --
|
||||
+-- --
|
||||
+-- GNAT was originally developed by the GNAT team at New York University. --
|
||||
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
|
||||
+-- --
|
||||
+------------------------------------------------------------------------------
|
||||
+
|
||||
+package System is
|
||||
+ pragma Pure;
|
||||
+ -- Note that we take advantage of the implementation permission to make
|
||||
+ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
|
||||
+ -- 2005, this is Pure in any case (AI-362).
|
||||
+
|
||||
+ pragma No_Elaboration_Code_All;
|
||||
+ -- Allow the use of that restriction in units that WITH this unit
|
||||
+
|
||||
+ type Name is (SYSTEM_NAME_GNAT);
|
||||
+ System_Name : constant Name := SYSTEM_NAME_GNAT;
|
||||
+
|
||||
+ -- System-Dependent Named Numbers
|
||||
+
|
||||
+ Min_Int : constant := Long_Long_Integer'First;
|
||||
+ Max_Int : constant := Long_Long_Integer'Last;
|
||||
+
|
||||
+ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
|
||||
+ Max_Nonbinary_Modulus : constant := Integer'Last;
|
||||
+
|
||||
+ Max_Base_Digits : constant := Long_Long_Float'Digits;
|
||||
+ Max_Digits : constant := Long_Long_Float'Digits;
|
||||
+
|
||||
+ Max_Mantissa : constant := 63;
|
||||
+ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
|
||||
+
|
||||
+ Tick : constant := 0.000_001;
|
||||
+
|
||||
+ -- Storage-related Declarations
|
||||
+
|
||||
+ type Address is private;
|
||||
+ pragma Preelaborable_Initialization (Address);
|
||||
+ Null_Address : constant Address;
|
||||
+
|
||||
+ Storage_Unit : constant := 8;
|
||||
+ Word_Size : constant := 64;
|
||||
+ Memory_Size : constant := 2 ** 64;
|
||||
+
|
||||
+ -- Address comparison
|
||||
+
|
||||
+ function "<" (Left, Right : Address) return Boolean;
|
||||
+ function "<=" (Left, Right : Address) return Boolean;
|
||||
+ function ">" (Left, Right : Address) return Boolean;
|
||||
+ function ">=" (Left, Right : Address) return Boolean;
|
||||
+ function "=" (Left, Right : Address) return Boolean;
|
||||
+
|
||||
+ pragma Import (Intrinsic, "<");
|
||||
+ pragma Import (Intrinsic, "<=");
|
||||
+ pragma Import (Intrinsic, ">");
|
||||
+ pragma Import (Intrinsic, ">=");
|
||||
+ pragma Import (Intrinsic, "=");
|
||||
+
|
||||
+ -- Other System-Dependent Declarations
|
||||
+
|
||||
+ type Bit_Order is (High_Order_First, Low_Order_First);
|
||||
+ Default_Bit_Order : constant Bit_Order := High_Order_First;
|
||||
+ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
|
||||
+
|
||||
+ -- Priority-related Declarations (RM D.1)
|
||||
+
|
||||
+ Max_Priority : constant Positive := 30;
|
||||
+ Max_Interrupt_Priority : constant Positive := 31;
|
||||
+
|
||||
+ subtype Any_Priority is Integer range 0 .. 31;
|
||||
+ subtype Priority is Any_Priority range 0 .. 30;
|
||||
+ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
|
||||
+
|
||||
+ Default_Priority : constant Priority := 15;
|
||||
+
|
||||
+private
|
||||
+
|
||||
+ type Address is mod Memory_Size;
|
||||
+ Null_Address : constant Address := 0;
|
||||
+
|
||||
+ --------------------------------------
|
||||
+ -- System Implementation Parameters --
|
||||
+ --------------------------------------
|
||||
+
|
||||
+ -- These parameters provide information about the target that is used
|
||||
+ -- by the compiler. They are in the private part of System, where they
|
||||
+ -- can be accessed using the special circuitry in the Targparm unit
|
||||
+ -- whose source should be consulted for more detailed descriptions
|
||||
+ -- of the individual switch values.
|
||||
+
|
||||
+ Backend_Divide_Checks : constant Boolean := False;
|
||||
+ Backend_Overflow_Checks : constant Boolean := True;
|
||||
+ Command_Line_Args : constant Boolean := True;
|
||||
+ Configurable_Run_Time : constant Boolean := False;
|
||||
+ Denorm : constant Boolean := True;
|
||||
+ Duration_32_Bits : constant Boolean := False;
|
||||
+ Exit_Status_Supported : constant Boolean := True;
|
||||
+ Fractional_Fixed_Ops : constant Boolean := False;
|
||||
+ Frontend_Layout : constant Boolean := False;
|
||||
+ Machine_Overflows : constant Boolean := False;
|
||||
+ Machine_Rounds : constant Boolean := True;
|
||||
+ Preallocated_Stacks : constant Boolean := False;
|
||||
+ Signed_Zeros : constant Boolean := True;
|
||||
+ Stack_Check_Default : constant Boolean := False;
|
||||
+ Stack_Check_Probes : constant Boolean := True;
|
||||
+ Stack_Check_Limits : constant Boolean := False;
|
||||
+ Support_Aggregates : constant Boolean := True;
|
||||
+ Support_Composite_Assign : constant Boolean := True;
|
||||
+ Support_Composite_Compare : constant Boolean := True;
|
||||
+ Support_Long_Shifts : constant Boolean := True;
|
||||
+ Always_Compatible_Rep : constant Boolean := False;
|
||||
+ Suppress_Standard_Library : constant Boolean := False;
|
||||
+ Use_Ada_Main_Program_Name : constant Boolean := False;
|
||||
+ Frontend_Exceptions : constant Boolean := False;
|
||||
+ ZCX_By_Default : constant Boolean := True;
|
||||
+
|
||||
+end System;
|
||||
--
|
||||
2.15.1
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
diff -rup gcc-5.1.0/gcc.orig/ada/adaint.c gcc-5.1.0/gcc/ada/adaint.c
|
||||
--- gcc-5.1.0/gcc.orig/ada/adaint.c 2015-02-20 11:48:57.000000000 +0000
|
||||
+++ gcc-5.1.0/gcc/ada/adaint.c 2015-06-02 10:47:51.672767476 +0000
|
||||
@@ -70,6 +70,11 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/pstat.h>
|
||||
#endif
|
||||
+
|
||||
+#if defined (linux)
|
||||
+#define _GNU_SOURCE 1
|
||||
+#include <sched.h>
|
||||
+#endif
|
||||
|
||||
#ifdef __PikeOS__
|
||||
#define __BSD_VISIBLE 1
|
||||
@@ -3057,8 +3062,6 @@ __gnat_lwp_self (void)
|
||||
return (void *) syscall (__NR_gettid);
|
||||
}
|
||||
|
||||
-#include <sched.h>
|
||||
-
|
||||
/* glibc versions earlier than 2.7 do not define the routines to handle
|
||||
dynamically allocated CPU sets. For these targets, we use the static
|
||||
versions. */
|
||||
@@ -3067,7 +3070,7 @@ __gnat_lwp_self (void)
|
||||
|
||||
/* Dynamic cpu sets */
|
||||
|
||||
-cpu_set_t *
|
||||
+void *
|
||||
__gnat_cpu_alloc (size_t count)
|
||||
{
|
||||
return CPU_ALLOC (count);
|
||||
@@ -3080,33 +3083,33 @@ __gnat_cpu_alloc_size (size_t count)
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_free (cpu_set_t *set)
|
||||
+__gnat_cpu_free (void *set)
|
||||
{
|
||||
- CPU_FREE (set);
|
||||
+ CPU_FREE ((cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_zero (size_t count, cpu_set_t *set)
|
||||
+__gnat_cpu_zero (size_t count, void *set)
|
||||
{
|
||||
- CPU_ZERO_S (count, set);
|
||||
+ CPU_ZERO_S (count, (cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set)
|
||||
+__gnat_cpu_set (int cpu, size_t count, void *set)
|
||||
{
|
||||
/* Ada handles CPU numbers starting from 1, while C identifies the first
|
||||
CPU by a 0, so we need to adjust. */
|
||||
- CPU_SET_S (cpu - 1, count, set);
|
||||
+ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set);
|
||||
}
|
||||
|
||||
#else /* !CPU_ALLOC */
|
||||
|
||||
/* Static cpu sets */
|
||||
|
||||
-cpu_set_t *
|
||||
+void *
|
||||
__gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED)
|
||||
{
|
||||
- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t));
|
||||
+ return xmalloc (sizeof (cpu_set_t));
|
||||
}
|
||||
|
||||
size_t
|
||||
@@ -3116,23 +3119,23 @@ __gnat_cpu_alloc_size (size_t count ATTR
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_free (cpu_set_t *set)
|
||||
+__gnat_cpu_free (void *set)
|
||||
{
|
||||
free (set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
|
||||
+__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set)
|
||||
{
|
||||
- CPU_ZERO (set);
|
||||
+ CPU_ZERO ((cpu_set_t *) set);
|
||||
}
|
||||
|
||||
void
|
||||
-__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
|
||||
+__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set)
|
||||
{
|
||||
/* Ada handles CPU numbers starting from 1, while C identifies the first
|
||||
CPU by a 0, so we need to adjust. */
|
||||
- CPU_SET (cpu - 1, set);
|
||||
+ CPU_SET (cpu - 1, (cpu_set_t *) set);
|
||||
}
|
||||
#endif /* !CPU_ALLOC */
|
||||
#endif /* linux */
|
||||
diff -rup gcc-5.1.0/gcc.orig/ada/adaint.h gcc-5.1.0/gcc/ada/adaint.h
|
||||
--- gcc-5.1.0/gcc.orig/ada/adaint.h 2015-01-27 17:20:27.000000000 +0000
|
||||
+++ gcc-5.1.0/gcc/ada/adaint.h 2015-06-02 10:47:23.188910894 +0000
|
||||
@@ -287,13 +287,11 @@ extern void *__gnat_lwp_self (voi
|
||||
|
||||
/* Routines for interface to required CPU set primitives */
|
||||
|
||||
-#include <sched.h>
|
||||
-
|
||||
-extern cpu_set_t *__gnat_cpu_alloc (size_t);
|
||||
+extern void * __gnat_cpu_alloc (size_t);
|
||||
extern size_t __gnat_cpu_alloc_size (size_t);
|
||||
-extern void __gnat_cpu_free (cpu_set_t *);
|
||||
-extern void __gnat_cpu_zero (size_t, cpu_set_t *);
|
||||
-extern void __gnat_cpu_set (int, size_t, cpu_set_t *);
|
||||
+extern void __gnat_cpu_free (void *);
|
||||
+extern void __gnat_cpu_zero (size_t, void *);
|
||||
+extern void __gnat_cpu_set (int, size_t, void *);
|
||||
#endif
|
||||
|
||||
#if defined (_WIN32)
|
||||
diff -rup gcc-5.1.0/gcc.orig/ada/gcc-interface/Makefile.in gcc-5.1.0/gcc/ada/gcc-interface/Makefile.in
|
||||
--- gcc-5.1.0/gcc.orig/ada/gcc-interface/Makefile.in 2015-04-09 20:29:28.000000000 +0000
|
||||
+++ gcc-5.1.0/gcc/ada/gcc-interface/Makefile.in 2015-06-02 10:47:23.188910894 +0000
|
||||
@@ -1910,7 +1910,7 @@ ifeq ($(strip $(filter-out powerpc% linu
|
||||
endif
|
||||
|
||||
# ARM linux, GNU eabi
|
||||
-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
|
||||
+ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
|
||||
LIBGNAT_TARGET_PAIRS = \
|
||||
a-intnam.ads<a-intnam-linux.ads \
|
||||
s-inmaop.adb<s-inmaop-posix.adb \
|
||||
@@ -0,0 +1,30 @@
|
||||
Index: b/gcc/ada/link.c
|
||||
===================================================================
|
||||
--- a/gcc/ada/link.c
|
||||
+++ b/gcc/ada/link.c
|
||||
@@ -105,9 +105,9 @@
|
||||
|
||||
#elif defined (__FreeBSD__)
|
||||
const char *__gnat_object_file_option = "-Wl,@";
|
||||
-const char *__gnat_run_path_option = "-Wl,-rpath,";
|
||||
-char __gnat_shared_libgnat_default = STATIC;
|
||||
-char __gnat_shared_libgcc_default = STATIC;
|
||||
+const char *__gnat_run_path_option = "";
|
||||
+char __gnat_shared_libgnat_default = SHARED;
|
||||
+char __gnat_shared_libgcc_default = SHARED;
|
||||
int __gnat_link_max = 8192;
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
@@ -127,9 +127,9 @@
|
||||
|
||||
#elif defined (linux) || defined(__GLIBC__)
|
||||
const char *__gnat_object_file_option = "-Wl,@";
|
||||
-const char *__gnat_run_path_option = "-Wl,-rpath,";
|
||||
-char __gnat_shared_libgnat_default = STATIC;
|
||||
-char __gnat_shared_libgcc_default = STATIC;
|
||||
+const char *__gnat_run_path_option = "";
|
||||
+char __gnat_shared_libgnat_default = SHARED;
|
||||
+char __gnat_shared_libgcc_default = SHARED;
|
||||
int __gnat_link_max = 8192;
|
||||
unsigned char __gnat_objlist_file_supported = 1;
|
||||
const char *__gnat_object_library_extension = ".a";
|
||||
@@ -0,0 +1,62 @@
|
||||
--- gcc-4.8.1/boehm-gc/os_dep.c.orig 2013-09-17 07:46:00.969884340 +0000
|
||||
+++ gcc-4.8.1/boehm-gc/os_dep.c 2013-09-17 06:53:53.629884946 +0000
|
||||
@@ -26,7 +26,7 @@
|
||||
# define __KERNEL__
|
||||
# include <asm/signal.h>
|
||||
# undef __KERNEL__
|
||||
-# else
|
||||
+# elif defined(__GLIBC__)
|
||||
/* Kernels prior to 2.1.1 defined struct sigcontext_struct instead of */
|
||||
/* struct sigcontext. libc6 (glibc2) uses "struct sigcontext" in */
|
||||
/* prototypes, so we have to include the top-level sigcontext.h to */
|
||||
--- gcc-4.8.2/boehm-gc/dyn_load.c.orig 2014-02-17 14:13:09.519850231 +0200
|
||||
+++ gcc-4.8.2/boehm-gc/dyn_load.c 2014-02-17 14:14:27.906093514 +0200
|
||||
@@ -459,9 +459,7 @@
|
||||
/* For glibc 2.2.4+. Unfortunately, it doesn't work for older */
|
||||
/* versions. Thanks to Jakub Jelinek for most of the code. */
|
||||
|
||||
-# if (defined(LINUX) || defined (__GLIBC__)) /* Are others OK here, too? */ \
|
||||
- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|
||||
- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
|
||||
+# if (defined(LINUX) || defined (__GLIBC__))
|
||||
|
||||
/* We have the header files for a glibc that includes dl_iterate_phdr. */
|
||||
/* It may still not be available in the library on the target system. */
|
||||
--- gcc-4.8.2/boehm-gc/include/private/gcconfig.h.orig 2014-02-17 14:14:36.026049422 +0200
|
||||
+++ gcc-4.8.2/boehm-gc/include/private/gcconfig.h 2014-02-17 14:17:11.345207887 +0200
|
||||
@@ -684,7 +684,7 @@
|
||||
# ifdef __ELF__
|
||||
# define DYNAMIC_LOADING
|
||||
# include <features.h>
|
||||
-# if defined(__GLIBC__)&& __GLIBC__>=2
|
||||
+# if 1
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# else /* !GLIBC2 */
|
||||
extern char **__environ;
|
||||
@@ -1147,7 +1147,7 @@
|
||||
# define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))
|
||||
# endif
|
||||
# include <features.h>
|
||||
-# if defined(__GLIBC__) && __GLIBC__ >= 2
|
||||
+# if 1
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# else
|
||||
extern char **__environ;
|
||||
@@ -1367,7 +1367,7 @@
|
||||
# define HBLKSIZE 4096
|
||||
# endif
|
||||
# define USE_GENERIC_PUSH_REGS
|
||||
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2 || __GLIBC__ > 2
|
||||
+# if 1
|
||||
# define LINUX_STACKBOTTOM
|
||||
# else
|
||||
# define STACKBOTTOM 0x80000000
|
||||
@@ -1858,7 +1858,7 @@
|
||||
# ifdef __ELF__
|
||||
# define DYNAMIC_LOADING
|
||||
# include <features.h>
|
||||
-# if defined(__GLIBC__) && __GLIBC__ >= 2
|
||||
+# if 1
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# else
|
||||
extern char **__environ;
|
||||
@@ -0,0 +1,10 @@
|
||||
--- gcc-4.8.1/Makefile.in.orig
|
||||
+++ gcc-4.8.1/Makefile.in
|
||||
@@ -169,6 +169,7 @@
|
||||
# built for the build system to override those in BASE_FLAGS_TO_PASSS.
|
||||
EXTRA_BUILD_FLAGS = \
|
||||
CFLAGS="$(CFLAGS_FOR_BUILD)" \
|
||||
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
|
||||
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
|
||||
|
||||
# This is the list of directories to built for the host system.
|
||||
@@ -0,0 +1,120 @@
|
||||
--- gcc-4.8.2/libjava/gnu/gcj/convert/natIconv.cc.orig 2014-02-18 18:46:14.897880526 +0200
|
||||
+++ gcc-4.8.2/libjava/gnu/gcj/convert/natIconv.cc 2014-02-18 18:50:08.766613550 +0200
|
||||
@@ -24,6 +24,13 @@
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
#include <iconv.h>
|
||||
+#include <endian.h>
|
||||
+
|
||||
+#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
+#define UCS2_CHARSET "UCS-2BE"
|
||||
+#else
|
||||
+#define UCS2_CHARSET "UCS-2LE"
|
||||
+#endif
|
||||
|
||||
template<typename T>
|
||||
static inline size_t
|
||||
@@ -45,7 +52,7 @@
|
||||
_Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
|
||||
buffer[len] = '\0';
|
||||
|
||||
- iconv_t h = iconv_open ("UCS-2", buffer);
|
||||
+ iconv_t h = iconv_open (UCS2_CHARSET, buffer);
|
||||
if (h == (iconv_t) -1)
|
||||
throw new ::java::io::UnsupportedEncodingException (encoding);
|
||||
|
||||
@@ -99,18 +106,6 @@
|
||||
throw new ::java::io::CharConversionException ();
|
||||
}
|
||||
|
||||
- if (iconv_byte_swap)
|
||||
- {
|
||||
- size_t max = (old_out - outavail) / sizeof (jchar);
|
||||
- for (size_t i = 0; i < max; ++i)
|
||||
- {
|
||||
- // Byte swap.
|
||||
- jchar c = (((out[outpos + i] & 0xff) << 8)
|
||||
- | ((out[outpos + i] >> 8) & 0xff));
|
||||
- outbuf[i] = c;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
inpos += old_in - inavail;
|
||||
return (old_out - outavail) / sizeof (jchar);
|
||||
#else /* HAVE_ICONV */
|
||||
@@ -145,7 +140,7 @@
|
||||
_Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
|
||||
buffer[len] = '\0';
|
||||
|
||||
- iconv_t h = iconv_open (buffer, "UCS-2");
|
||||
+ iconv_t h = iconv_open (buffer, UCS2_CHARSET);
|
||||
if (h == (iconv_t) -1)
|
||||
throw new ::java::io::UnsupportedEncodingException (encoding);
|
||||
|
||||
@@ -187,20 +182,6 @@
|
||||
char *inbuf = (char *) &chars[inpos];
|
||||
char *outbuf = (char *) &out[count];
|
||||
|
||||
- if (iconv_byte_swap)
|
||||
- {
|
||||
- // Ugly performance penalty -- don't use losing systems!
|
||||
- temp_buffer = (jchar *) _Jv_Malloc (inlength * sizeof (jchar));
|
||||
- for (int i = 0; i < inlength; ++i)
|
||||
- {
|
||||
- // Byte swap.
|
||||
- jchar c = (((chars[inpos + i] & 0xff) << 8)
|
||||
- | ((chars[inpos + i] >> 8) & 0xff));
|
||||
- temp_buffer[i] = c;
|
||||
- }
|
||||
- inbuf = (char *) temp_buffer;
|
||||
- }
|
||||
-
|
||||
size_t loop_old_in = old_in;
|
||||
while (1)
|
||||
{
|
||||
@@ -252,44 +233,7 @@
|
||||
jboolean
|
||||
gnu::gcj::convert::IOConverter::iconv_init (void)
|
||||
{
|
||||
- // Some versions of iconv() always return their UCS-2 results in
|
||||
- // big-endian order, and they also require UCS-2 inputs to be in
|
||||
- // big-endian order. For instance, glibc 2.1.3 does this. If the
|
||||
- // UTF-8=>UCS-2 iconv converter has this feature, then we assume
|
||||
- // that all UCS-2 converters do. (This might not be the best
|
||||
- // heuristic, but is is all we've got.)
|
||||
- jboolean result = false;
|
||||
-#ifdef HAVE_ICONV
|
||||
- iconv_t handle = iconv_open ("UCS-2", "UTF-8");
|
||||
- if (handle != (iconv_t) -1)
|
||||
- {
|
||||
- jchar c;
|
||||
- unsigned char in[4];
|
||||
- char *inp, *outp;
|
||||
- size_t inc, outc, r;
|
||||
-
|
||||
- // This is the UTF-8 encoding of \ufeff. At least Tru64 UNIX libiconv
|
||||
- // needs the trailing NUL byte, otherwise iconv fails with EINVAL.
|
||||
- in[0] = 0xef;
|
||||
- in[1] = 0xbb;
|
||||
- in[2] = 0xbf;
|
||||
- in[3] = 0x00;
|
||||
-
|
||||
- inp = (char *) in;
|
||||
- inc = 4;
|
||||
- outp = (char *) &c;
|
||||
- outc = 2;
|
||||
-
|
||||
- r = iconv_adapter (iconv, handle, &inp, &inc, &outp, &outc);
|
||||
- // Conversion must be complete for us to use the result.
|
||||
- if (r != (size_t) -1 && inc == 0 && outc == 0)
|
||||
- result = (c != 0xfeff);
|
||||
-
|
||||
- // Release iconv handle.
|
||||
- iconv_close (handle);
|
||||
- }
|
||||
-#endif /* HAVE_ICONV */
|
||||
- return result;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -0,0 +1,49 @@
|
||||
--- gcc-4.8.2/libjava/gnu/classpath/natSystemProperties.cc.orig 2014-02-18 10:55:08.617678779 +0200
|
||||
+++ gcc-4.8.2/libjava/gnu/classpath/natSystemProperties.cc 2014-02-18 10:56:31.927227453 +0200
|
||||
@@ -289,7 +289,7 @@
|
||||
// just default to `en_US'.
|
||||
setlocale (LC_ALL, "");
|
||||
char *locale = setlocale (LC_MESSAGES, "");
|
||||
- if (locale && strlen (locale) >= 2)
|
||||
+ if (locale && strlen (locale) >= 2 && (locale[2] == '\0' || locale[2] == '_'))
|
||||
{
|
||||
char buf[3];
|
||||
buf[2] = '\0';
|
||||
--- gcc-4.8.2/libjava/posix-threads.cc.orig 2014-02-18 13:22:01.789933726 +0200
|
||||
+++ gcc-4.8.2/libjava/posix-threads.cc 2014-02-18 13:29:50.924058875 +0200
|
||||
@@ -657,6 +657,7 @@
|
||||
struct sched_param param;
|
||||
pthread_attr_t attr;
|
||||
struct starter *info;
|
||||
+ size_t ss;
|
||||
|
||||
if (data->flags & FLAG_START)
|
||||
return;
|
||||
@@ -675,8 +676,25 @@
|
||||
// Set stack size if -Xss option was given.
|
||||
if (gcj::stack_size > 0)
|
||||
{
|
||||
- int e = pthread_attr_setstacksize (&attr, gcj::stack_size);
|
||||
+ ss = gcj::stack_size;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ int e = pthread_attr_getstacksize (&attr, &ss);
|
||||
+ if (e != 0)
|
||||
+ JvFail (strerror (e));
|
||||
+
|
||||
+ // Request at least 1meg of stack
|
||||
+ if (ss >= 1024 * 1024)
|
||||
+ ss = 0;
|
||||
+ else
|
||||
+ ss = 1024 * 1024;
|
||||
+ }
|
||||
+
|
||||
+ if (ss)
|
||||
+ {
|
||||
+ int e = pthread_attr_setstacksize (&attr, ss);
|
||||
if (e != 0)
|
||||
JvFail (strerror (e));
|
||||
}
|
||||
|
||||
info = (struct starter *) _Jv_AllocBytes (sizeof (struct starter));
|
||||
@@ -0,0 +1,35 @@
|
||||
--- gcc-6.1.0/libjava/Makefile.am
|
||||
+++ gcc-6.1.0/libjava/Makefile.am
|
||||
@@ -488,10 +488,14 @@
|
||||
nat_files = $(nat_source_files:.cc=.lo)
|
||||
xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
|
||||
|
||||
+libgcj_la_CPPFLAGS = \
|
||||
+ $(AM_CPPFLAGS) \
|
||||
+ $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
|
||||
+
|
||||
# Include THREADLIBS here to ensure that the correct version of
|
||||
# certain linuxthread functions get linked:
|
||||
## The mysterious backslash in the grep pattern is consumed by make.
|
||||
-libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(extra_ldflags) $(THREADLIBS) \
|
||||
+libgcj_la_LDFLAGS = $(LIBSTDCXX_RAW_CXX_LDFLAGS) -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(extra_ldflags) $(THREADLIBS) \
|
||||
$(LIBLTDL) $(SYS_ZLIBS) $(LIBJAVA_LDFLAGS_NOUNDEF) \
|
||||
-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
|
||||
$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBGCJ_LD_EXPORT_ALL)
|
||||
--- gcc-6.1.0/libjava/Makefile.in
|
||||
+++ gcc-6.1.0/libjava/Makefile.in
|
||||
@@ -1103,9 +1103,13 @@
|
||||
nat_files = $(nat_source_files:.cc=.lo)
|
||||
xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
|
||||
|
||||
+libgcj_la_CPPFLAGS = \
|
||||
+ $(AM_CPPFLAGS) \
|
||||
+ $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
|
||||
+
|
||||
# Include THREADLIBS here to ensure that the correct version of
|
||||
# certain linuxthread functions get linked:
|
||||
-libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(extra_ldflags) $(THREADLIBS) \
|
||||
+libgcj_la_LDFLAGS = $(LIBSTDCXX_RAW_CXX_LDFLAGS) -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(extra_ldflags) $(THREADLIBS) \
|
||||
$(LIBLTDL) $(SYS_ZLIBS) $(LIBJAVA_LDFLAGS_NOUNDEF) \
|
||||
-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
|
||||
$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBGCJ_LD_EXPORT_ALL)
|
||||
@@ -0,0 +1,44 @@
|
||||
From 9cd4503714c4e596818c4ea8e15905c249b7a319 Mon Sep 17 00:00:00 2001
|
||||
From: nsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Thu, 25 Aug 2016 14:08:27 +0000
|
||||
Subject: [PATCH] [mips] Fix linux header use in libgcc
|
||||
|
||||
libgcc/
|
||||
* config/mips/linux-unwind.h: Use sys/syscall.h.
|
||||
|
||||
|
||||
|
||||
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239759 138bc75d-0d04-0410-961f-82ee72b054a4
|
||||
---
|
||||
libgcc/ChangeLog | 4 ++++
|
||||
libgcc/config/mips/linux-unwind.h | 2 +-
|
||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
|
||||
index b78c4b2..99bd2f1 100644
|
||||
--- a/libgcc/ChangeLog
|
||||
+++ b/libgcc/ChangeLog
|
||||
@@ -1,3 +1,7 @@
|
||||
+2016-08-25 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
||||
+
|
||||
+ * config/mips/linux-unwind.h: Use sys/syscall.h.
|
||||
+
|
||||
2016-08-16 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
PR libgcc/77265
|
||||
diff --git a/libgcc/config/mips/linux-unwind.h b/libgcc/config/mips/linux-unwind.h
|
||||
index bf12de5..4035c121 100644
|
||||
--- a/libgcc/config/mips/linux-unwind.h
|
||||
+++ b/libgcc/config/mips/linux-unwind.h
|
||||
@@ -27,7 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
state data appropriately. See unwind-dw2.c for the structs. */
|
||||
|
||||
#include <signal.h>
|
||||
-#include <asm/unistd.h>
|
||||
+#include <sys/syscall.h>
|
||||
|
||||
/* The third parameter to the signal handler points to something with
|
||||
* this structure defined in asm/ucontext.h, but the name clashes with
|
||||
--
|
||||
2.9.3
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
--- gcc-6.3.0.orig/gcc/config/rs6000/sysv4.h
|
||||
+++ gcc-6.3.0/gcc/config/rs6000/sysv4.h
|
||||
@@ -753,23 +753,42 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LD_PIE
|
||||
-#define STARTFILE_LINUX_SPEC "\
|
||||
-%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
|
||||
-%{mnewlib:ecrti.o%s;:crti.o%s} \
|
||||
-%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
|
||||
-" CRTOFFLOADBEGIN
|
||||
+#define STARTFILE_LINUX_SPEC \
|
||||
+ "%{!shared: %{pg|p|profile:gcrt1.o%s;: \
|
||||
+ %{" PIE_SPEC ":%{static:rcrt1.o%s;:Scrt1.o%s}} %{" NO_PIE_SPEC ":crt1.o%s}}} \
|
||||
+ crti.o%s %{shared:crtbeginS.o%s;: \
|
||||
+ %{" PIE_SPEC ":crtbeginS.o%s} \
|
||||
+ %{" NO_PIE_SPEC ":%{static:crtbeginT.o%s;:crtbegin.o%s}}} \
|
||||
+ %{fvtable-verify=none:%s; \
|
||||
+ fvtable-verify=preinit:vtv_start_preinit.o%s; \
|
||||
+ fvtable-verify=std:vtv_start.o%s} \
|
||||
+ " CRTOFFLOADBEGIN
|
||||
#else
|
||||
-#define STARTFILE_LINUX_SPEC "\
|
||||
-%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
|
||||
-%{mnewlib:ecrti.o%s;:crti.o%s} \
|
||||
-%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
|
||||
-" CRTOFFLOADBEGIN
|
||||
+#define STARTFILE_LINUX_SPEC \
|
||||
+ "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
|
||||
+ crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
|
||||
+ %{fvtable-verify=none:%s; \
|
||||
+ fvtable-verify=preinit:vtv_start_preinit.o%s; \
|
||||
+ fvtable-verify=std:vtv_start.o%s} \
|
||||
+ " CRTOFFLOADBEGIN
|
||||
#endif
|
||||
|
||||
-#define ENDFILE_LINUX_SPEC "\
|
||||
-%{shared|pie:crtendS.o%s;:crtend.o%s} \
|
||||
-%{mnewlib:ecrtn.o%s;:crtn.o%s} \
|
||||
-" CRTOFFLOADEND
|
||||
+#ifdef HAVE_LD_PIE
|
||||
+#define ENDFILE_LINUX_SPEC \
|
||||
+ "%{fvtable-verify=none:%s; \
|
||||
+ fvtable-verify=preinit:vtv_end_preinit.o%s; \
|
||||
+ fvtable-verify=std:vtv_end.o%s} \
|
||||
+ %{shared:crtendS.o%s;: %{" PIE_SPEC ":crtendS.o%s} \
|
||||
+ %{" NO_PIE_SPEC ":crtend.o%s}} crtn.o%s \
|
||||
+ " CRTOFFLOADEND
|
||||
+#else
|
||||
+#define ENDFILE_LINUX_SPEC \
|
||||
+ "%{fvtable-verify=none:%s; \
|
||||
+ fvtable-verify=preinit:vtv_end_preinit.o%s; \
|
||||
+ fvtable-verify=std:vtv_end.o%s} \
|
||||
+ %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s \
|
||||
+ " CRTOFFLOADEND
|
||||
+#endif
|
||||
|
||||
#define LINK_START_LINUX_SPEC ""
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
When cross compiling a target gcc, target flags may be used on the host
|
||||
|
||||
Configure identifies a number of warning flags (WARN_CFLAGS and
|
||||
WARN_CXXFLAGS) from the $CC value. The cross compiler may be different
|
||||
from the host compiler and may not support the same set of flags. This
|
||||
leads to problems such as:
|
||||
|
||||
cc1plus: error: unrecognized command line option "-Wno-narrowing"
|
||||
cc1plus: error: unrecognized command line option "-Wno-overlength-strings"
|
||||
|
||||
Work around this problem by removing the warning flags from the
|
||||
BUILD_CXXFLAGS value, in a way similar to the BUILD_CFLAGS.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
|
||||
|
||||
Index: gcc-4.8.0/gcc/configure
|
||||
===================================================================
|
||||
--- gcc-4.8.0.orig/gcc/configure
|
||||
+++ gcc-4.8.0/gcc/configure
|
||||
@@ -11720,6 +10581,7 @@ STMP_FIXINC=stmp-fixinc
|
||||
if test x$build != x$host || test "x$coverage_flags" != x
|
||||
then
|
||||
BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
|
||||
+ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
|
||||
BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
|
||||
fi
|
||||
|
||||
Index: gcc-4.8.0/gcc/configure.ac
|
||||
===================================================================
|
||||
--- gcc-4.8.0.orig/gcc/configure.ac
|
||||
+++ gcc-4.8.0/gcc/configure.ac
|
||||
@@ -1901,6 +1901,7 @@ STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_F
|
||||
if test x$build != x$host || test "x$coverage_flags" != x
|
||||
then
|
||||
BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
|
||||
+ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
|
||||
BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- gcc-4.9.2/gcc/config/linux.h.orig 2015-03-09 13:27:13.289736710 +0000
|
||||
+++ gcc-4.9.2/gcc/config/linux.h 2015-03-09 13:29:32.295625046 +0000
|
||||
@@ -146,6 +146,8 @@
|
||||
|
||||
#ifdef NATIVE_SYSTEM_HEADER_DIR
|
||||
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
|
||||
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
|
||||
+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
|
||||
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
|
||||
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
|
||||
#else
|
||||
@@ -0,0 +1,20 @@
|
||||
Author: Timo Teräs <timo.teras@iki.fi>
|
||||
|
||||
Alpine musl package provides libssp_nonshared.a. We link to it unconditionally,
|
||||
as otherwise we get link failures if some objects are -fstack-protector built
|
||||
and final link happens with -fno-stack-protector. This seems to be the common
|
||||
case when bootstrapping gcc, the piepatches do not seem to fully fix the
|
||||
crosstoolchain and bootstrap sequence wrt. stack-protector flag usage.
|
||||
|
||||
--- gcc-6.1.0/gcc/gcc.c.orig
|
||||
+++ gcc-6.1.0/gcc/gcc.c
|
||||
@@ -870,8 +870,7 @@
|
||||
|
||||
#ifndef LINK_SSP_SPEC
|
||||
#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
- "|fstack-protector-strong|fstack-protector-explicit:}"
|
||||
+#define LINK_SSP_SPEC "-lssp_nonshared"
|
||||
#else
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
"|fstack-protector-strong|fstack-protector-explicit" \
|
||||
@@ -0,0 +1,47 @@
|
||||
From b8c4e45d052adc247341066f748421743704b481 Mon Sep 17 00:00:00 2001
|
||||
From: Nils Andreas Svee <me@lochnair.net>
|
||||
Date: Thu, 21 Dec 2017 03:14:33 +0100
|
||||
Subject: [PATCH] Pure 64-bit MIPS
|
||||
|
||||
---
|
||||
gcc/config/mips/mips.h | 8 ++++----
|
||||
gcc/config/mips/t-linux64 | 6 +++---
|
||||
2 files changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
|
||||
index 803ab98e7..afd74752f 100644
|
||||
--- a/gcc/config/mips/mips.h
|
||||
+++ b/gcc/config/mips/mips.h
|
||||
@@ -3330,11 +3330,11 @@ struct GTY(()) machine_function {
|
||||
/* If we are *not* using multilibs and the default ABI is not ABI_32 we
|
||||
need to change these from /lib and /usr/lib. */
|
||||
#if MIPS_ABI_DEFAULT == ABI_N32
|
||||
-#define STANDARD_STARTFILE_PREFIX_1 "/lib32/"
|
||||
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib32/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
|
||||
#elif MIPS_ABI_DEFAULT == ABI_64
|
||||
-#define STANDARD_STARTFILE_PREFIX_1 "/lib64/"
|
||||
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib64/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
|
||||
#endif
|
||||
|
||||
/* Load store bonding is not supported by micromips and fix_24k. The
|
||||
diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
|
||||
index 16c8adf85..bb46204db 100644
|
||||
--- a/gcc/config/mips/t-linux64
|
||||
+++ b/gcc/config/mips/t-linux64
|
||||
@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64
|
||||
MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
|
||||
MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
|
||||
MULTILIB_OSDIRNAMES = \
|
||||
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
|
||||
- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
|
||||
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
|
||||
+ ../lib \
|
||||
+ ../lib32 \
|
||||
+ ../lib
|
||||
--
|
||||
2.15.1
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
--- ./gcc/config/i386/t-linux64.orig 2013-01-14 16:32:37.000000000 +0000
|
||||
+++ ./gcc/config/i386/t-linux64 2013-04-22 06:12:32.984439677 +0000
|
||||
@@ -34,6 +34,6 @@
|
||||
comma=,
|
||||
MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
|
||||
MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
|
||||
-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
|
||||
-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
|
||||
--- ./gcc/config/aarch64/t-aarch64-linux.orig
|
||||
+++ ./gcc/config/aarch64/t-aarch64-linux
|
||||
@@ -22,7 +22,7 @@
|
||||
LIB1ASMFUNCS = _aarch64_sync_cache_range
|
||||
|
||||
AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
|
||||
-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES = mabi.lp64=../lib
|
||||
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
|
||||
|
||||
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
|
||||
--- ./gcc/config/s390/t-linux64.orig
|
||||
+++ ./gcc/config/s390/t-linux64
|
||||
@@ -7,5 +7,5 @@
|
||||
MULTILIB_OPTIONS = m64/m31
|
||||
MULTILIB_DIRNAMES = 64 32
|
||||
-MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu)
|
||||
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
|
||||
--- ./gcc/config/rs6000/t-linux.orig
|
||||
+++ ./gcc/config/rs6000/t-linux
|
||||
@@ -2,7 +2,8 @@
|
||||
# or soft-float.
|
||||
ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float)))
|
||||
ifneq (,$(findstring powerpc64,$(target)))
|
||||
-MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
else
|
||||
ifneq (,$(findstring spe,$(target)))
|
||||
MULTIARCH_DIRNAME := powerpc-linux-gnuspe$(if $(findstring 8548,$(with_cpu)),,v1)
|
||||
@@ -14,7 +15,8 @@
|
||||
MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME))
|
||||
endif
|
||||
ifneq (,$(findstring powerpc64le,$(target)))
|
||||
-MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
endif
|
||||
endif
|
||||
|
||||
--- ./gcc/config/rs6000/t-linux64.orig
|
||||
+++ ./gcc/config/rs6000/t-linux64
|
||||
@@ -28,8 +28,8 @@
|
||||
MULTILIB_OPTIONS := m64/m32
|
||||
MULTILIB_DIRNAMES := 64 32
|
||||
MULTILIB_EXTRA_OPTS :=
|
||||
-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
|
||||
-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
|
||||
rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
|
||||
$(COMPILE) $<
|
||||
--- ./gcc/config/rs6000/t-linux64bele.orig
|
||||
+++ ./gcc/config/rs6000/t-linux64bele
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
MULTILIB_OPTIONS += mlittle
|
||||
MULTILIB_DIRNAMES += le
|
||||
-MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))))))
|
||||
-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES)))
|
||||
+MULTILIB_OSDIRNAMES = m64=../lib
|
||||
+MULTILIB_OSDIRNAMES+= m32=../lib32
|
||||
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
|
||||
--- ./gcc/config/rs6000/t-linux64lebe.orig
|
||||
+++ ./gcc/config/rs6000/t-linux64lebe
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
MULTILIB_OPTIONS += mbig
|
||||
MULTILIB_DIRNAMES += be
|
||||
-MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES))))))
|
||||
-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES)))
|
||||
+MULTILIB_OSDIRNAMES := m64=../lib
|
||||
+MULTILIB_OSDIRNAMES += m32=../lib32
|
||||
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
|
||||
@@ -0,0 +1,39 @@
|
||||
Highly inspired by:
|
||||
http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
|
||||
|
||||
diff -durN gcc-4.6.0.orig/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in
|
||||
--- gcc-4.6.0.orig/libgcc/Makefile.in 2011-01-26 05:19:58.000000000 +0100
|
||||
+++ gcc-4.6.0/libgcc/Makefile.in 2011-09-12 18:17:12.743718974 +0200
|
||||
@@ -772,8 +772,9 @@
|
||||
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
|
||||
endif
|
||||
|
||||
+all: libgcc_eh.a
|
||||
ifeq ($(enable_shared),yes)
|
||||
-all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
|
||||
+all: libgcc_s$(SHLIB_EXT)
|
||||
ifneq ($(LIBUNWIND),)
|
||||
all: libunwind$(SHLIB_EXT)
|
||||
endif
|
||||
@@ -950,10 +951,6 @@
|
||||
install-shared:
|
||||
$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
|
||||
|
||||
- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
|
||||
- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
-
|
||||
$(subst @multilib_dir@,$(MULTIDIR),$(subst \
|
||||
@shlib_base_name@,libgcc_s,$(subst \
|
||||
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
|
||||
@@ -968,6 +965,10 @@
|
||||
chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
|
||||
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
|
||||
|
||||
+ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
|
||||
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
|
||||
+
|
||||
parts="$(INSTALL_PARTS)"; \
|
||||
for file in $$parts; do \
|
||||
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
|
||||
@@ -0,0 +1,241 @@
|
||||
From b1d2df5090abc9202a7bf2d224ac90de22908d21 Mon Sep 17 00:00:00 2001
|
||||
From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Mon, 15 Jan 2018 11:27:24 +0000
|
||||
Subject: [PATCH 01/13] i386: Move struct ix86_frame to machine_function
|
||||
|
||||
Make ix86_frame available to i386 code generation. This is needed to
|
||||
backport the patch set of -mindirect-branch= to mitigate variant #2 of
|
||||
the speculative execution vulnerabilities on x86 processors identified
|
||||
by CVE-2017-5715, aka Spectre.
|
||||
|
||||
Backport from mainline
|
||||
2017-06-01 Bernd Edlinger <bernd.edlinger@hotmail.de>
|
||||
|
||||
* config/i386/i386.c (ix86_frame): Moved to ...
|
||||
* config/i386/i386.h (ix86_frame): Here.
|
||||
(machine_function): Add frame.
|
||||
* config/i386/i386.c (ix86_compute_frame_layout): Repace the
|
||||
frame argument with &cfun->machine->frame.
|
||||
(ix86_can_use_return_insn_p): Don't pass &frame to
|
||||
ix86_compute_frame_layout. Copy frame from cfun->machine->frame.
|
||||
(ix86_can_eliminate): Likewise.
|
||||
(ix86_expand_prologue): Likewise.
|
||||
(ix86_expand_epilogue): Likewise.
|
||||
(ix86_expand_split_stack_prologue): Likewise.
|
||||
---
|
||||
gcc/config/i386/i386.c | 68 ++++++++++----------------------------------------
|
||||
gcc/config/i386/i386.h | 53 ++++++++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 65 insertions(+), 56 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index 8b5faac5129..a1ff32b648b 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -2434,53 +2434,6 @@ struct GTY(()) stack_local_entry {
|
||||
struct stack_local_entry *next;
|
||||
};
|
||||
|
||||
-/* Structure describing stack frame layout.
|
||||
- Stack grows downward:
|
||||
-
|
||||
- [arguments]
|
||||
- <- ARG_POINTER
|
||||
- saved pc
|
||||
-
|
||||
- saved static chain if ix86_static_chain_on_stack
|
||||
-
|
||||
- saved frame pointer if frame_pointer_needed
|
||||
- <- HARD_FRAME_POINTER
|
||||
- [saved regs]
|
||||
- <- regs_save_offset
|
||||
- [padding0]
|
||||
-
|
||||
- [saved SSE regs]
|
||||
- <- sse_regs_save_offset
|
||||
- [padding1] |
|
||||
- | <- FRAME_POINTER
|
||||
- [va_arg registers] |
|
||||
- |
|
||||
- [frame] |
|
||||
- |
|
||||
- [padding2] | = to_allocate
|
||||
- <- STACK_POINTER
|
||||
- */
|
||||
-struct ix86_frame
|
||||
-{
|
||||
- int nsseregs;
|
||||
- int nregs;
|
||||
- int va_arg_size;
|
||||
- int red_zone_size;
|
||||
- int outgoing_arguments_size;
|
||||
-
|
||||
- /* The offsets relative to ARG_POINTER. */
|
||||
- HOST_WIDE_INT frame_pointer_offset;
|
||||
- HOST_WIDE_INT hard_frame_pointer_offset;
|
||||
- HOST_WIDE_INT stack_pointer_offset;
|
||||
- HOST_WIDE_INT hfp_save_offset;
|
||||
- HOST_WIDE_INT reg_save_offset;
|
||||
- HOST_WIDE_INT sse_reg_save_offset;
|
||||
-
|
||||
- /* When save_regs_using_mov is set, emit prologue using
|
||||
- move instead of push instructions. */
|
||||
- bool save_regs_using_mov;
|
||||
-};
|
||||
-
|
||||
/* Which cpu are we scheduling for. */
|
||||
enum attr_cpu ix86_schedule;
|
||||
|
||||
@@ -2572,7 +2525,7 @@ static unsigned int ix86_function_arg_boundary (machine_mode,
|
||||
const_tree);
|
||||
static rtx ix86_static_chain (const_tree, bool);
|
||||
static int ix86_function_regparm (const_tree, const_tree);
|
||||
-static void ix86_compute_frame_layout (struct ix86_frame *);
|
||||
+static void ix86_compute_frame_layout (void);
|
||||
static bool ix86_expand_vector_init_one_nonzero (bool, machine_mode,
|
||||
rtx, rtx, int);
|
||||
static void ix86_add_new_builtins (HOST_WIDE_INT);
|
||||
@@ -10944,7 +10897,8 @@ ix86_can_use_return_insn_p (void)
|
||||
if (crtl->args.pops_args && crtl->args.size >= 32768)
|
||||
return 0;
|
||||
|
||||
- ix86_compute_frame_layout (&frame);
|
||||
+ ix86_compute_frame_layout ();
|
||||
+ frame = cfun->machine->frame;
|
||||
return (frame.stack_pointer_offset == UNITS_PER_WORD
|
||||
&& (frame.nregs + frame.nsseregs) == 0);
|
||||
}
|
||||
@@ -11355,8 +11309,8 @@ ix86_can_eliminate (const int from, const int to)
|
||||
HOST_WIDE_INT
|
||||
ix86_initial_elimination_offset (int from, int to)
|
||||
{
|
||||
- struct ix86_frame frame;
|
||||
- ix86_compute_frame_layout (&frame);
|
||||
+ ix86_compute_frame_layout ();
|
||||
+ struct ix86_frame frame = cfun->machine->frame;
|
||||
|
||||
if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
|
||||
return frame.hard_frame_pointer_offset;
|
||||
@@ -11395,8 +11349,9 @@ ix86_builtin_setjmp_frame_value (void)
|
||||
/* Fill structure ix86_frame about frame of currently computed function. */
|
||||
|
||||
static void
|
||||
-ix86_compute_frame_layout (struct ix86_frame *frame)
|
||||
+ix86_compute_frame_layout (void)
|
||||
{
|
||||
+ struct ix86_frame *frame = &cfun->machine->frame;
|
||||
unsigned HOST_WIDE_INT stack_alignment_needed;
|
||||
HOST_WIDE_INT offset;
|
||||
unsigned HOST_WIDE_INT preferred_alignment;
|
||||
@@ -12702,7 +12657,8 @@ ix86_expand_prologue (void)
|
||||
m->fs.sp_offset = INCOMING_FRAME_SP_OFFSET;
|
||||
m->fs.sp_valid = true;
|
||||
|
||||
- ix86_compute_frame_layout (&frame);
|
||||
+ ix86_compute_frame_layout ();
|
||||
+ frame = m->frame;
|
||||
|
||||
if (!TARGET_64BIT && ix86_function_ms_hook_prologue (current_function_decl))
|
||||
{
|
||||
@@ -13379,7 +13335,8 @@ ix86_expand_epilogue (int style)
|
||||
bool using_drap;
|
||||
|
||||
ix86_finalize_stack_realign_flags ();
|
||||
- ix86_compute_frame_layout (&frame);
|
||||
+ ix86_compute_frame_layout ();
|
||||
+ frame = m->frame;
|
||||
|
||||
m->fs.sp_valid = (!frame_pointer_needed
|
||||
|| (crtl->sp_is_unchanging
|
||||
@@ -13876,7 +13833,8 @@ ix86_expand_split_stack_prologue (void)
|
||||
gcc_assert (flag_split_stack && reload_completed);
|
||||
|
||||
ix86_finalize_stack_realign_flags ();
|
||||
- ix86_compute_frame_layout (&frame);
|
||||
+ ix86_compute_frame_layout ();
|
||||
+ frame = cfun->machine->frame;
|
||||
allocate = frame.stack_pointer_offset - INCOMING_FRAME_SP_OFFSET;
|
||||
|
||||
/* This is the label we will branch to if we have enough stack
|
||||
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
|
||||
index 8113f83c7fd..54144166172 100644
|
||||
--- a/gcc/config/i386/i386.h
|
||||
+++ b/gcc/config/i386/i386.h
|
||||
@@ -2427,9 +2427,56 @@ enum avx_u128_state
|
||||
|
||||
#define FASTCALL_PREFIX '@'
|
||||
|
||||
+#ifndef USED_FOR_TARGET
|
||||
+/* Structure describing stack frame layout.
|
||||
+ Stack grows downward:
|
||||
+
|
||||
+ [arguments]
|
||||
+ <- ARG_POINTER
|
||||
+ saved pc
|
||||
+
|
||||
+ saved static chain if ix86_static_chain_on_stack
|
||||
+
|
||||
+ saved frame pointer if frame_pointer_needed
|
||||
+ <- HARD_FRAME_POINTER
|
||||
+ [saved regs]
|
||||
+ <- regs_save_offset
|
||||
+ [padding0]
|
||||
+
|
||||
+ [saved SSE regs]
|
||||
+ <- sse_regs_save_offset
|
||||
+ [padding1] |
|
||||
+ | <- FRAME_POINTER
|
||||
+ [va_arg registers] |
|
||||
+ |
|
||||
+ [frame] |
|
||||
+ |
|
||||
+ [padding2] | = to_allocate
|
||||
+ <- STACK_POINTER
|
||||
+ */
|
||||
+struct GTY(()) ix86_frame
|
||||
+{
|
||||
+ int nsseregs;
|
||||
+ int nregs;
|
||||
+ int va_arg_size;
|
||||
+ int red_zone_size;
|
||||
+ int outgoing_arguments_size;
|
||||
+
|
||||
+ /* The offsets relative to ARG_POINTER. */
|
||||
+ HOST_WIDE_INT frame_pointer_offset;
|
||||
+ HOST_WIDE_INT hard_frame_pointer_offset;
|
||||
+ HOST_WIDE_INT stack_pointer_offset;
|
||||
+ HOST_WIDE_INT hfp_save_offset;
|
||||
+ HOST_WIDE_INT reg_save_offset;
|
||||
+ HOST_WIDE_INT sse_reg_save_offset;
|
||||
+
|
||||
+ /* When save_regs_using_mov is set, emit prologue using
|
||||
+ move instead of push instructions. */
|
||||
+ bool save_regs_using_mov;
|
||||
+};
|
||||
+
|
||||
/* Machine specific frame tracking during prologue/epilogue generation. */
|
||||
|
||||
-#ifndef USED_FOR_TARGET
|
||||
struct GTY(()) machine_frame_state
|
||||
{
|
||||
/* This pair tracks the currently active CFA as reg+offset. When reg
|
||||
@@ -2475,6 +2522,9 @@ struct GTY(()) machine_function {
|
||||
int varargs_fpr_size;
|
||||
int optimize_mode_switching[MAX_386_ENTITIES];
|
||||
|
||||
+ /* Cached initial frame layout for the current function. */
|
||||
+ struct ix86_frame frame;
|
||||
+
|
||||
/* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE
|
||||
has been computed for. */
|
||||
int use_fast_prologue_epilogue_nregs;
|
||||
@@ -2554,6 +2604,7 @@ struct GTY(()) machine_function {
|
||||
#define ix86_current_function_calls_tls_descriptor \
|
||||
(ix86_tls_descriptor_calls_expanded_in_cfun && df_regs_ever_live_p (SP_REG))
|
||||
#define ix86_static_chain_on_stack (cfun->machine->static_chain_on_stack)
|
||||
+#define ix86_red_zone_size (cfun->machine->frame.red_zone_size)
|
||||
|
||||
/* Control behavior of x86_file_start. */
|
||||
#define X86_FILE_START_VERSION_DIRECTIVE false
|
||||
--
|
||||
2.16.3
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
From b1fc91cda7c15264116f3dde6944ead149123653 Mon Sep 17 00:00:00 2001
|
||||
From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Mon, 15 Jan 2018 11:28:44 +0000
|
||||
Subject: [PATCH 02/13] i386: Use reference of struct ix86_frame to avoid copy
|
||||
|
||||
When there is no need to make a copy of ix86_frame, we can use reference
|
||||
of struct ix86_frame to avoid copy.
|
||||
|
||||
Backport from mainline
|
||||
2017-11-06 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* config/i386/i386.c (ix86_can_use_return_insn_p): Use reference
|
||||
of struct ix86_frame.
|
||||
(ix86_initial_elimination_offset): Likewise.
|
||||
(ix86_expand_split_stack_prologue): Likewise.
|
||||
---
|
||||
gcc/config/i386/i386.c | 8 +++-----
|
||||
1 file changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index a1ff32b648b..13ebf107e90 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -10887,7 +10887,6 @@ symbolic_reference_mentioned_p (rtx op)
|
||||
bool
|
||||
ix86_can_use_return_insn_p (void)
|
||||
{
|
||||
- struct ix86_frame frame;
|
||||
|
||||
if (! reload_completed || frame_pointer_needed)
|
||||
return 0;
|
||||
@@ -10898,7 +10897,7 @@ ix86_can_use_return_insn_p (void)
|
||||
return 0;
|
||||
|
||||
ix86_compute_frame_layout ();
|
||||
- frame = cfun->machine->frame;
|
||||
+ struct ix86_frame &frame = cfun->machine->frame;
|
||||
return (frame.stack_pointer_offset == UNITS_PER_WORD
|
||||
&& (frame.nregs + frame.nsseregs) == 0);
|
||||
}
|
||||
@@ -11310,7 +11309,7 @@ HOST_WIDE_INT
|
||||
ix86_initial_elimination_offset (int from, int to)
|
||||
{
|
||||
ix86_compute_frame_layout ();
|
||||
- struct ix86_frame frame = cfun->machine->frame;
|
||||
+ struct ix86_frame &frame = cfun->machine->frame;
|
||||
|
||||
if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
|
||||
return frame.hard_frame_pointer_offset;
|
||||
@@ -13821,7 +13820,6 @@ static GTY(()) rtx split_stack_fn_large;
|
||||
void
|
||||
ix86_expand_split_stack_prologue (void)
|
||||
{
|
||||
- struct ix86_frame frame;
|
||||
HOST_WIDE_INT allocate;
|
||||
unsigned HOST_WIDE_INT args_size;
|
||||
rtx_code_label *label;
|
||||
@@ -13834,7 +13832,7 @@ ix86_expand_split_stack_prologue (void)
|
||||
|
||||
ix86_finalize_stack_realign_flags ();
|
||||
ix86_compute_frame_layout ();
|
||||
- frame = cfun->machine->frame;
|
||||
+ struct ix86_frame &frame = cfun->machine->frame;
|
||||
allocate = frame.stack_pointer_offset - INCOMING_FRAME_SP_OFFSET;
|
||||
|
||||
/* This is the label we will branch to if we have enough stack
|
||||
--
|
||||
2.16.3
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
From 3e39c0a8053b3e960cf4c3aea3c814e7dc97cfd6 Mon Sep 17 00:00:00 2001
|
||||
From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Sat, 27 Jan 2018 13:10:24 +0000
|
||||
Subject: [PATCH 03/13] i386: Use const reference of struct ix86_frame to avoid
|
||||
copy
|
||||
|
||||
We can use const reference of struct ix86_frame to avoid making a local
|
||||
copy of ix86_frame. ix86_expand_epilogue makes a local copy of struct
|
||||
ix86_frame and uses the reg_save_offset field as a local variable. This
|
||||
patch uses a separate local variable for reg_save_offset.
|
||||
|
||||
Tested on x86-64 with ada.
|
||||
|
||||
Backport from mainline
|
||||
PR target/83905
|
||||
* config/i386/i386.c (ix86_expand_prologue): Use cost reference
|
||||
of struct ix86_frame.
|
||||
(ix86_expand_epilogue): Likewise. Add a local variable for
|
||||
the reg_save_offset field in struct ix86_frame.
|
||||
|
||||
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@257123 138bc75d-0d04-0410-961f-82ee72b054a4
|
||||
---
|
||||
gcc/config/i386/i386.c | 24 ++++++++++++------------
|
||||
1 file changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index 13ebf107e90..6c98f7581e2 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -12633,7 +12633,6 @@ ix86_expand_prologue (void)
|
||||
{
|
||||
struct machine_function *m = cfun->machine;
|
||||
rtx insn, t;
|
||||
- struct ix86_frame frame;
|
||||
HOST_WIDE_INT allocate;
|
||||
bool int_registers_saved;
|
||||
bool sse_registers_saved;
|
||||
@@ -12657,7 +12656,7 @@ ix86_expand_prologue (void)
|
||||
m->fs.sp_valid = true;
|
||||
|
||||
ix86_compute_frame_layout ();
|
||||
- frame = m->frame;
|
||||
+ const struct ix86_frame &frame = cfun->machine->frame;
|
||||
|
||||
if (!TARGET_64BIT && ix86_function_ms_hook_prologue (current_function_decl))
|
||||
{
|
||||
@@ -13329,13 +13328,12 @@ ix86_expand_epilogue (int style)
|
||||
{
|
||||
struct machine_function *m = cfun->machine;
|
||||
struct machine_frame_state frame_state_save = m->fs;
|
||||
- struct ix86_frame frame;
|
||||
bool restore_regs_via_mov;
|
||||
bool using_drap;
|
||||
|
||||
ix86_finalize_stack_realign_flags ();
|
||||
ix86_compute_frame_layout ();
|
||||
- frame = m->frame;
|
||||
+ const struct ix86_frame &frame = cfun->machine->frame;
|
||||
|
||||
m->fs.sp_valid = (!frame_pointer_needed
|
||||
|| (crtl->sp_is_unchanging
|
||||
@@ -13377,11 +13375,13 @@ ix86_expand_epilogue (int style)
|
||||
+ UNITS_PER_WORD);
|
||||
}
|
||||
|
||||
+ HOST_WIDE_INT reg_save_offset = frame.reg_save_offset;
|
||||
+
|
||||
/* Special care must be taken for the normal return case of a function
|
||||
using eh_return: the eax and edx registers are marked as saved, but
|
||||
not restored along this path. Adjust the save location to match. */
|
||||
if (crtl->calls_eh_return && style != 2)
|
||||
- frame.reg_save_offset -= 2 * UNITS_PER_WORD;
|
||||
+ reg_save_offset -= 2 * UNITS_PER_WORD;
|
||||
|
||||
/* EH_RETURN requires the use of moves to function properly. */
|
||||
if (crtl->calls_eh_return)
|
||||
@@ -13397,11 +13397,11 @@ ix86_expand_epilogue (int style)
|
||||
else if (TARGET_EPILOGUE_USING_MOVE
|
||||
&& cfun->machine->use_fast_prologue_epilogue
|
||||
&& (frame.nregs > 1
|
||||
- || m->fs.sp_offset != frame.reg_save_offset))
|
||||
+ || m->fs.sp_offset != reg_save_offset))
|
||||
restore_regs_via_mov = true;
|
||||
else if (frame_pointer_needed
|
||||
&& !frame.nregs
|
||||
- && m->fs.sp_offset != frame.reg_save_offset)
|
||||
+ && m->fs.sp_offset != reg_save_offset)
|
||||
restore_regs_via_mov = true;
|
||||
else if (frame_pointer_needed
|
||||
&& TARGET_USE_LEAVE
|
||||
@@ -13439,7 +13439,7 @@ ix86_expand_epilogue (int style)
|
||||
rtx t;
|
||||
|
||||
if (frame.nregs)
|
||||
- ix86_emit_restore_regs_using_mov (frame.reg_save_offset, style == 2);
|
||||
+ ix86_emit_restore_regs_using_mov (reg_save_offset, style == 2);
|
||||
|
||||
/* eh_return epilogues need %ecx added to the stack pointer. */
|
||||
if (style == 2)
|
||||
@@ -13529,19 +13529,19 @@ ix86_expand_epilogue (int style)
|
||||
epilogues. */
|
||||
if (!m->fs.sp_valid
|
||||
|| (TARGET_SEH
|
||||
- && (m->fs.sp_offset - frame.reg_save_offset
|
||||
+ && (m->fs.sp_offset - reg_save_offset
|
||||
>= SEH_MAX_FRAME_SIZE)))
|
||||
{
|
||||
pro_epilogue_adjust_stack (stack_pointer_rtx, hard_frame_pointer_rtx,
|
||||
GEN_INT (m->fs.fp_offset
|
||||
- - frame.reg_save_offset),
|
||||
+ - reg_save_offset),
|
||||
style, false);
|
||||
}
|
||||
- else if (m->fs.sp_offset != frame.reg_save_offset)
|
||||
+ else if (m->fs.sp_offset != reg_save_offset)
|
||||
{
|
||||
pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx,
|
||||
GEN_INT (m->fs.sp_offset
|
||||
- - frame.reg_save_offset),
|
||||
+ - reg_save_offset),
|
||||
style,
|
||||
m->fs.cfa_reg == stack_pointer_rtx);
|
||||
}
|
||||
--
|
||||
2.16.3
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Loaded 100 of 1997 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user