From fc715924773fc8f20f95041020626b8968852133 Mon Sep 17 00:00:00 2001 From: SuLingGG <1215009714@QQ.COM> Date: Thu, 6 Aug 2020 13:10:43 +0800 Subject: [PATCH 01/19] Fix baidupcs-web file name to fit i386 device --- package/lean/baidupcs-web/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/lean/baidupcs-web/Makefile b/package/lean/baidupcs-web/Makefile index 0540b060d8..7f00fbb6f7 100644 --- a/package/lean/baidupcs-web/Makefile +++ b/package/lean/baidupcs-web/Makefile @@ -30,7 +30,7 @@ endef STRIP:=true ifeq ($(ARCH),i386) - PKG_ARCH_BAIDUPCS-WEB:=86 + PKG_ARCH_BAIDUPCS-WEB:=386 endif ifeq ($(ARCH),x86_64) From 872331baf99e6f2d626b543a7a26f85fb41209ed Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Fri, 7 Aug 2020 17:36:22 +0800 Subject: [PATCH 02/19] luci-app-ssr-plus: bump to 180-3 --- package/lean/luci-app-ssr-plus/Makefile | 2 +- .../root/etc/config/shadowsocksr | 2 +- .../root/etc/ssr/china_ssr.txt | 13 ++-- .../root/etc/ssr/gfw_list.conf | 70 +++---------------- .../luci-app-ssr-plus/root/usr/bin/ssr-rules | 4 +- 5 files changed, 22 insertions(+), 69 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index 32db9ce6e4..1572aa4f4b 100644 --- a/package/lean/luci-app-ssr-plus/Makefile +++ b/package/lean/luci-app-ssr-plus/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ssr-plus PKG_VERSION:=180 -PKG_RELEASE:=2 +PKG_RELEASE:=3 include $(INCLUDE_DIR)/package.mk diff --git a/package/lean/luci-app-ssr-plus/root/etc/config/shadowsocksr b/package/lean/luci-app-ssr-plus/root/etc/config/shadowsocksr index 4329c7839e..e0cfa78f10 100644 --- a/package/lean/luci-app-ssr-plus/root/etc/config/shadowsocksr +++ b/package/lean/luci-app-ssr-plus/root/etc/config/shadowsocksr @@ -13,7 +13,7 @@ config global option gfwlist_url 'https://cdn.jsdelivr.net/gh/Loukky/gfwlist-by-loukky/gfwlist.txt' option chnroute_url 'https://ispip.clang.cn/all_cn.txt' option nfip_url 'https://cdn.jsdelivr.net/gh/QiuSimons/Netflix_IP/getflix.txt' - option adblock_url 'https://gitee.com/privacy-protection-tools/anti-ad/raw/master/anti-ad-for-dnsmasq.conf' + option adblock_url 'https://anti-ad.net/anti-ad-for-dnsmasq.conf' option threads '0' option global_server 'disable' option netflix_server 'nil' diff --git a/package/lean/luci-app-ssr-plus/root/etc/ssr/china_ssr.txt b/package/lean/luci-app-ssr-plus/root/etc/ssr/china_ssr.txt index 5c8eba7e29..e8079c796a 100644 --- a/package/lean/luci-app-ssr-plus/root/etc/ssr/china_ssr.txt +++ b/package/lean/luci-app-ssr-plus/root/etc/ssr/china_ssr.txt @@ -3669,7 +3669,6 @@ 103.110.156.0/22 103.110.188.0/22 103.110.204.0/22 -103.111.38.0/23 103.111.64.0/22 103.111.172.0/22 103.111.252.0/22 @@ -4061,6 +4060,15 @@ 103.152.250.0/23 103.153.4.0/23 103.153.36.0/23 +103.153.98.0/23 +103.153.100.0/23 +103.153.114.0/23 +103.153.122.0/23 +103.153.128.0/23 +103.153.132.0/23 +103.153.138.0/23 +103.153.146.0/23 +103.153.160.0/23 103.192.0.0/22 103.192.4.0/22 103.192.8.0/22 @@ -4461,7 +4469,6 @@ 103.215.116.0/22 103.215.120.0/22 103.215.140.0/22 -103.215.184.0/22 103.215.228.0/22 103.216.4.0/22 103.216.8.0/22 @@ -5424,7 +5431,6 @@ 116.204.216.0/22 116.204.232.0/22 116.204.236.0/22 -116.204.244.0/22 116.205.0.0/16 116.206.92.0/22 116.206.176.0/22 @@ -6119,7 +6125,6 @@ 157.119.12.0/22 157.119.16.0/22 157.119.28.0/22 -157.119.68.0/22 157.119.132.0/22 157.119.136.0/22 157.119.140.0/22 diff --git a/package/lean/luci-app-ssr-plus/root/etc/ssr/gfw_list.conf b/package/lean/luci-app-ssr-plus/root/etc/ssr/gfw_list.conf index 83f93ce5af..7f787ddbaa 100644 --- a/package/lean/luci-app-ssr-plus/root/etc/ssr/gfw_list.conf +++ b/package/lean/luci-app-ssr-plus/root/etc/ssr/gfw_list.conf @@ -326,8 +326,6 @@ server=/airvpn.org/127.0.0.1#5335 ipset=/airvpn.org/gfwlist server=/aisex.com/127.0.0.1#5335 ipset=/aisex.com/gfwlist -server=/aiss.anws.gov.tw/127.0.0.1#5335 -ipset=/aiss.anws.gov.tw/gfwlist server=/ait.org.tw/127.0.0.1#5335 ipset=/ait.org.tw/gfwlist server=/aiweiwei.com/127.0.0.1#5335 @@ -2064,8 +2062,6 @@ server=/data-vocabulary.org/127.0.0.1#5335 ipset=/data-vocabulary.org/gfwlist server=/data.flurry.com/127.0.0.1#5335 ipset=/data.flurry.com/gfwlist -server=/data.gov.tw/127.0.0.1#5335 -ipset=/data.gov.tw/gfwlist server=/daum.net/127.0.0.1#5335 ipset=/daum.net/gfwlist server=/david-kilgour.com/127.0.0.1#5335 @@ -2560,8 +2556,6 @@ server=/entnt.com/127.0.0.1#5335 ipset=/entnt.com/gfwlist server=/environment.google/127.0.0.1#5335 ipset=/environment.google/gfwlist -server=/epa.gov.tw/127.0.0.1#5335 -ipset=/epa.gov.tw/gfwlist server=/epac.to/127.0.0.1#5335 ipset=/epac.to/gfwlist server=/episcopalchurch.org/127.0.0.1#5335 @@ -2670,6 +2664,8 @@ server=/eurekavpt.com/127.0.0.1#5335 ipset=/eurekavpt.com/gfwlist server=/euronews.com/127.0.0.1#5335 ipset=/euronews.com/gfwlist +server=/evchk.wikia.org/127.0.0.1#5335 +ipset=/evchk.wikia.org/gfwlist server=/evschool.net/127.0.0.1#5335 ipset=/evschool.net/gfwlist server=/exblog.jp/127.0.0.1#5335 @@ -2710,8 +2706,6 @@ server=/ezpeer.com/127.0.0.1#5335 ipset=/ezpeer.com/gfwlist server=/ezua.com/127.0.0.1#5335 ipset=/ezua.com/gfwlist -server=/fa.gov.tw/127.0.0.1#5335 -ipset=/fa.gov.tw/gfwlist server=/facebook.br/127.0.0.1#5335 ipset=/facebook.br/gfwlist server=/facebook.com/127.0.0.1#5335 @@ -2876,8 +2870,6 @@ server=/fc2china.com/127.0.0.1#5335 ipset=/fc2china.com/gfwlist server=/fc2cn.com/127.0.0.1#5335 ipset=/fc2cn.com/gfwlist -server=/fda.gov.tw/127.0.0.1#5335 -ipset=/fda.gov.tw/gfwlist server=/fdc64.de/127.0.0.1#5335 ipset=/fdc64.de/gfwlist server=/fdc64.org/127.0.0.1#5335 @@ -4186,6 +4178,8 @@ server=/hotshame.com/127.0.0.1#5335 ipset=/hotshame.com/gfwlist server=/hotspotshield.com/127.0.0.1#5335 ipset=/hotspotshield.com/gfwlist +server=/hottg.com/127.0.0.1#5335 +ipset=/hottg.com/gfwlist server=/hotvpn.com/127.0.0.1#5335 ipset=/hotvpn.com/gfwlist server=/hougaige.com/127.0.0.1#5335 @@ -4194,8 +4188,6 @@ server=/howtoforge.com/127.0.0.1#5335 ipset=/howtoforge.com/gfwlist server=/hoxx.com/127.0.0.1#5335 ipset=/hoxx.com/gfwlist -server=/hpa.gov.tw/127.0.0.1#5335 -ipset=/hpa.gov.tw/gfwlist server=/hqcdp.org/127.0.0.1#5335 ipset=/hqcdp.org/gfwlist server=/hqjapanesesex.com/127.0.0.1#5335 @@ -4464,8 +4456,6 @@ server=/imkev.com/127.0.0.1#5335 ipset=/imkev.com/gfwlist server=/imlive.com/127.0.0.1#5335 ipset=/imlive.com/gfwlist -server=/immigration.gov.tw/127.0.0.1#5335 -ipset=/immigration.gov.tw/gfwlist server=/immoral.jp/127.0.0.1#5335 ipset=/immoral.jp/gfwlist server=/impact.org.au/127.0.0.1#5335 @@ -4610,8 +4600,6 @@ server=/isuntv.com/127.0.0.1#5335 ipset=/isuntv.com/gfwlist server=/itaboo.info/127.0.0.1#5335 ipset=/itaboo.info/gfwlist -server=/itaiwan.gov.tw/127.0.0.1#5335 -ipset=/itaiwan.gov.tw/gfwlist server=/italiatibet.org/127.0.0.1#5335 ipset=/italiatibet.org/gfwlist server=/itasoftware.com/127.0.0.1#5335 @@ -5576,8 +5564,6 @@ server=/mixx.com/127.0.0.1#5335 ipset=/mixx.com/gfwlist server=/mizzmona.com/127.0.0.1#5335 ipset=/mizzmona.com/gfwlist -server=/mjib.gov.tw/127.0.0.1#5335 -ipset=/mjib.gov.tw/gfwlist server=/mk5000.com/127.0.0.1#5335 ipset=/mk5000.com/gfwlist server=/mlcool.com/127.0.0.1#5335 @@ -5604,12 +5590,8 @@ server=/moby.to/127.0.0.1#5335 ipset=/moby.to/gfwlist server=/mobypicture.com/127.0.0.1#5335 ipset=/mobypicture.com/gfwlist -server=/moeaic.gov.tw/127.0.0.1#5335 -ipset=/moeaic.gov.tw/gfwlist server=/moeerolibrary.com/127.0.0.1#5335 ipset=/moeerolibrary.com/gfwlist -server=/mofa.gov.tw/127.0.0.1#5335 -ipset=/mofa.gov.tw/gfwlist server=/mofaxiehui.com/127.0.0.1#5335 ipset=/mofaxiehui.com/gfwlist server=/mofos.com/127.0.0.1#5335 @@ -5622,8 +5604,6 @@ server=/mohu.ml/127.0.0.1#5335 ipset=/mohu.ml/gfwlist server=/mojim.com/127.0.0.1#5335 ipset=/mojim.com/gfwlist -server=/mol.gov.tw/127.0.0.1#5335 -ipset=/mol.gov.tw/gfwlist server=/molihua.org/127.0.0.1#5335 ipset=/molihua.org/gfwlist server=/mondex.org/127.0.0.1#5335 @@ -5718,8 +5698,6 @@ server=/muzi.com/127.0.0.1#5335 ipset=/muzi.com/gfwlist server=/muzi.net/127.0.0.1#5335 ipset=/muzi.net/gfwlist -server=/mvdis.gov.tw/127.0.0.1#5335 -ipset=/mvdis.gov.tw/gfwlist server=/mvg.jp/127.0.0.1#5335 ipset=/mvg.jp/gfwlist server=/mx981.com/127.0.0.1#5335 @@ -5852,8 +5830,6 @@ server=/naol.ca/127.0.0.1#5335 ipset=/naol.ca/gfwlist server=/naol.cc/127.0.0.1#5335 ipset=/naol.cc/gfwlist -server=/nat.gov.tw/127.0.0.1#5335 -ipset=/nat.gov.tw/gfwlist server=/nat.moe/127.0.0.1#5335 ipset=/nat.moe/gfwlist server=/national-lottery.co.uk/127.0.0.1#5335 @@ -5994,8 +5970,6 @@ server=/ngensis.com/127.0.0.1#5335 ipset=/ngensis.com/gfwlist server=/nhentai.net/127.0.0.1#5335 ipset=/nhentai.net/gfwlist -server=/nhi.gov.tw/127.0.0.1#5335 -ipset=/nhi.gov.tw/gfwlist server=/nhk-ondemand.jp/127.0.0.1#5335 ipset=/nhk-ondemand.jp/gfwlist server=/nic.cz.cc/127.0.0.1#5335 @@ -6070,8 +6044,6 @@ server=/noypf.com/127.0.0.1#5335 ipset=/noypf.com/gfwlist server=/npa.go.jp/127.0.0.1#5335 ipset=/npa.go.jp/gfwlist -server=/npa.gov.tw/127.0.0.1#5335 -ipset=/npa.gov.tw/gfwlist server=/npnt.me/127.0.0.1#5335 ipset=/npnt.me/gfwlist server=/nps.gov/127.0.0.1#5335 @@ -6098,14 +6070,6 @@ server=/ns2.name/127.0.0.1#5335 ipset=/ns2.name/gfwlist server=/ns3.name/127.0.0.1#5335 ipset=/ns3.name/gfwlist -server=/nsc.gov.tw/127.0.0.1#5335 -ipset=/nsc.gov.tw/gfwlist -server=/ntbk.gov.tw/127.0.0.1#5335 -ipset=/ntbk.gov.tw/gfwlist -server=/ntbna.gov.tw/127.0.0.1#5335 -ipset=/ntbna.gov.tw/gfwlist -server=/ntbt.gov.tw/127.0.0.1#5335 -ipset=/ntbt.gov.tw/gfwlist server=/ntd.tv/127.0.0.1#5335 ipset=/ntd.tv/gfwlist server=/ntdtv.ca/127.0.0.1#5335 @@ -6122,8 +6086,6 @@ server=/ntdtvla.com/127.0.0.1#5335 ipset=/ntdtvla.com/gfwlist server=/ntrfun.com/127.0.0.1#5335 ipset=/ntrfun.com/gfwlist -server=/ntsna.gov.tw/127.0.0.1#5335 -ipset=/ntsna.gov.tw/gfwlist server=/nubiles.net/127.0.0.1#5335 ipset=/nubiles.net/gfwlist server=/nudezz.com/127.0.0.1#5335 @@ -6434,8 +6396,6 @@ server=/pbxes.org/127.0.0.1#5335 ipset=/pbxes.org/gfwlist server=/pcanywhere.net/127.0.0.1#5335 ipset=/pcanywhere.net/gfwlist -server=/pcc.gov.tw/127.0.0.1#5335 -ipset=/pcc.gov.tw/gfwlist server=/pcdvd.com.tw/127.0.0.1#5335 ipset=/pcdvd.com.tw/gfwlist server=/pchome.com.tw/127.0.0.1#5335 @@ -7744,8 +7704,6 @@ server=/startpage.com/127.0.0.1#5335 ipset=/startpage.com/gfwlist server=/startuplivingchina.com/127.0.0.1#5335 ipset=/startuplivingchina.com/gfwlist -server=/stat.gov.tw/127.0.0.1#5335 -ipset=/stat.gov.tw/gfwlist server=/static-economist.com/127.0.0.1#5335 ipset=/static-economist.com/gfwlist server=/static.shemalez.com/127.0.0.1#5335 @@ -7922,8 +7880,6 @@ server=/taaze.tw/127.0.0.1#5335 ipset=/taaze.tw/gfwlist server=/tabtter.jp/127.0.0.1#5335 ipset=/tabtter.jp/gfwlist -server=/tacc.cwb.gov.tw/127.0.0.1#5335 -ipset=/tacc.cwb.gov.tw/gfwlist server=/tacem.org/127.0.0.1#5335 ipset=/tacem.org/gfwlist server=/taconet.com.tw/127.0.0.1#5335 @@ -7938,8 +7894,6 @@ server=/tagwalk.com/127.0.0.1#5335 ipset=/tagwalk.com/gfwlist server=/tahr.org.tw/127.0.0.1#5335 ipset=/tahr.org.tw/gfwlist -server=/taipei.gov.tw/127.0.0.1#5335 -ipset=/taipei.gov.tw/gfwlist server=/taipeisociety.org/127.0.0.1#5335 ipset=/taipeisociety.org/gfwlist server=/taiwan-sex.com/127.0.0.1#5335 @@ -7952,8 +7906,6 @@ server=/taiwandaily.net/127.0.0.1#5335 ipset=/taiwandaily.net/gfwlist server=/taiwandc.org/127.0.0.1#5335 ipset=/taiwandc.org/gfwlist -server=/taiwanjobs.gov.tw/127.0.0.1#5335 -ipset=/taiwanjobs.gov.tw/gfwlist server=/taiwanjustice.com/127.0.0.1#5335 ipset=/taiwanjustice.com/gfwlist server=/taiwanjustice.net/127.0.0.1#5335 @@ -8064,10 +8016,6 @@ server=/techviz.net/127.0.0.1#5335 ipset=/techviz.net/gfwlist server=/teck.in/127.0.0.1#5335 ipset=/teck.in/gfwlist -server=/teco-hk.org/127.0.0.1#5335 -ipset=/teco-hk.org/gfwlist -server=/teco-mo.org/127.0.0.1#5335 -ipset=/teco-mo.org/gfwlist server=/teddysun.com/127.0.0.1#5335 ipset=/teddysun.com/gfwlist server=/teeniefuck.net/127.0.0.1#5335 @@ -8106,10 +8054,10 @@ server=/textnow.me/127.0.0.1#5335 ipset=/textnow.me/gfwlist server=/tfhub.dev/127.0.0.1#5335 ipset=/tfhub.dev/gfwlist +server=/tgstat.com/127.0.0.1#5335 +ipset=/tgstat.com/gfwlist server=/thaicn.com/127.0.0.1#5335 ipset=/thaicn.com/gfwlist -server=/thb.gov.tw/127.0.0.1#5335 -ipset=/thb.gov.tw/gfwlist server=/theatrum-belli.com/127.0.0.1#5335 ipset=/theatrum-belli.com/gfwlist server=/thebcomplex.com/127.0.0.1#5335 @@ -8410,8 +8358,6 @@ server=/tinychat.com/127.0.0.1#5335 ipset=/tinychat.com/gfwlist server=/tinypaste.com/127.0.0.1#5335 ipset=/tinypaste.com/gfwlist -server=/tipo.gov.tw/127.0.0.1#5335 -ipset=/tipo.gov.tw/gfwlist server=/tistory.com/127.0.0.1#5335 ipset=/tistory.com/gfwlist server=/tkcs-collins.com/127.0.0.1#5335 @@ -8534,6 +8480,8 @@ server=/traffichaus.com/127.0.0.1#5335 ipset=/traffichaus.com/gfwlist server=/transparency.org/127.0.0.1#5335 ipset=/transparency.org/gfwlist +server=/travelinkcard.com/127.0.0.1#5335 +ipset=/travelinkcard.com/gfwlist server=/treemall.com.tw/127.0.0.1#5335 ipset=/treemall.com.tw/gfwlist server=/trendsmap.com/127.0.0.1#5335 @@ -9408,8 +9356,6 @@ server=/waveprotocol.org/127.0.0.1#5335 ipset=/waveprotocol.org/gfwlist server=/waymo.com/127.0.0.1#5335 ipset=/waymo.com/gfwlist -server=/wda.gov.tw/127.0.0.1#5335 -ipset=/wda.gov.tw/gfwlist server=/wdf5.com/127.0.0.1#5335 ipset=/wdf5.com/gfwlist server=/wearehairy.com/127.0.0.1#5335 diff --git a/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-rules b/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-rules index 9dcf96803e..3f0aa2d840 100755 --- a/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-rules +++ b/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-rules @@ -243,7 +243,9 @@ tp_rule() { $ipt -A SS_SPEC_TPROXY -p udp $PROXY_PORTS -m set --match-set china dst \ -j TPROXY --on-port "$LOCAL_PORT" --tproxy-mark 0x01/0x01 ;; - all) $ipt -A SS_SPEC_TPROXY -p udp $PROXY_PORTS -j TPROXY --on-port "$LOCAL_PORT" --tproxy-mark 0x01/0x01 ;; + all) + $ipt -A SS_SPEC_TPROXY -p udp $PROXY_PORTS -j TPROXY --on-port "$LOCAL_PORT" --tproxy-mark 0x01/0x01 + ;; esac $ipt -I PREROUTING 1 ${IFNAME:+-i $IFNAME} -p udp $EXT_ARGS $MATCH_SET \ -m comment --comment "$TAG" -j SS_SPEC_TPROXY From ba16561d922d635dbfb4ff912d7fdeca26df99fc Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Fri, 7 Aug 2020 17:38:13 +0800 Subject: [PATCH 03/19] brook: bump to 20200801 --- package/lienol/brook/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/lienol/brook/Makefile b/package/lienol/brook/Makefile index 9a8bf46555..b6abc508ae 100644 --- a/package/lienol/brook/Makefile +++ b/package/lienol/brook/Makefile @@ -35,7 +35,7 @@ ifeq ($(ARCH),aarch64) endif PKG_NAME:=brook -PKG_VERSION:=20200701 +PKG_VERSION:=20200801 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=brook$(PKG_ARCH_BROOK) From a31b6d005381641421fff886ef8ae91e3c271ee0 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Fri, 7 Aug 2020 17:39:16 +0800 Subject: [PATCH 04/19] v2ray: bump to 4.27.0 --- package/lean/v2ray/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lean/v2ray/Makefile b/package/lean/v2ray/Makefile index 081429db62..b656abad58 100644 --- a/package/lean/v2ray/Makefile +++ b/package/lean/v2ray/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2ray -PKG_VERSION:=4.26.0 +PKG_VERSION:=4.27.0 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/v2ray-core-$(PKG_VERSION) PKG_SOURCE:=v2ray-core-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=233e5acaf69a612c130655fea21291ffcce81a52771310ef97871b641e5f29d6 +PKG_HASH:=5e1b0146953398a5422611b20f5e62c3a9c3efd62cd42295762f6f39d8eff31e PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE From 8b01ddcc4a8c45d91c5b5fba67d2d01a34c7328c Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Fri, 7 Aug 2020 17:40:13 +0800 Subject: [PATCH 05/19] v2ray-plugin: bump to 1.3.5 --- package/ctcgfw/openwrt-v2ray-plugin/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/ctcgfw/openwrt-v2ray-plugin/Makefile b/package/ctcgfw/openwrt-v2ray-plugin/Makefile index 7fed1062a6..201c5c943b 100644 --- a/package/ctcgfw/openwrt-v2ray-plugin/Makefile +++ b/package/ctcgfw/openwrt-v2ray-plugin/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2ray-plugin -PKG_VERSION:=1.3.4 +PKG_VERSION:=1.3.5 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/teddysun/v2ray-plugin/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=59f91575953e8289d0f6d007836eab169b8ee62e44b31b1a3eef61525db1e69c +PKG_HASH:=46b3b9aec066df710f7ff27518c73c94ed63bbcdd6827e759da8627bf300a8d9 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE From dc20178fa9a1e87f31110b7998e0c91db560fd13 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 5 Aug 2020 19:57:43 +0200 Subject: [PATCH 06/19] binutils: update to version 2.34 Fixes perf on aarch64 Signed-off-by: Felix Fietkau --- package/devel/binutils/Makefile | 25 +- ...-compiler-sanitization-flags-on-to-l.patch | 65 - ...rget-binaries-ensure-that-the-warnin.patch | 1258 ----------------- 3 files changed, 19 insertions(+), 1329 deletions(-) delete mode 100644 package/devel/binutils/patches/0001-Do-not-pass-host-compiler-sanitization-flags-on-to-l.patch delete mode 100644 package/devel/binutils/patches/0002-When-building-target-binaries-ensure-that-the-warnin.patch diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile index e04611f5d3..6ad326efa0 100644 --- a/package/devel/binutils/Makefile +++ b/package/devel/binutils/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=binutils -PKG_VERSION:=2.27 +PKG_VERSION:=2.34 PKG_RELEASE:=1 PKG_SOURCE_URL:=@GNU/binutils -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_VERSION:=$(PKG_VERSION) -PKG_HASH:=369737ce51587f92466041a97ab7d2358c6d9e1b6490b3940eb09fb0a9a6ac88 +PKG_HASH:=f00b0e8803dc9bab1e2165bd568528135be734df3fabf8d0161828cd56028952 PKG_FIXUP:=autoreconf PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl @@ -37,10 +37,17 @@ define Package/libbfd DEPENDS:=+zlib $(ICONV_DEPENDS) $(INTL_DEPENDS) endef +define Package/libctf + SECTION:=libs + CATEGORY:=Libraries + TITLE:=libctf + DEPENDS:=+libbfd +endef + define Package/libopcodes SECTION:=libs CATEGORY:=Libraries - TITLE:=libbfd + TITLE:=libopcodes DEPENDS:=+libbfd endef @@ -56,7 +63,7 @@ define Package/objdump SECTION:=devel CATEGORY:=Development TITLE:=objdump - DEPENDS:=+libopcodes + DEPENDS:=+libopcodes +libctf endef define Package/ar @@ -94,7 +101,12 @@ endef define Package/libbfd/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so* $(1)/usr/lib/ +endef + +define Package/libctf/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libctf.so* $(1)/usr/lib/ endef define Package/libopcodes/install @@ -121,6 +133,7 @@ define Package/binutils/install endef $(eval $(call BuildPackage,libbfd)) +$(eval $(call BuildPackage,libctf)) $(eval $(call BuildPackage,libopcodes)) $(eval $(call BuildPackage,binutils)) $(eval $(call BuildPackage,objdump)) diff --git a/package/devel/binutils/patches/0001-Do-not-pass-host-compiler-sanitization-flags-on-to-l.patch b/package/devel/binutils/patches/0001-Do-not-pass-host-compiler-sanitization-flags-on-to-l.patch deleted file mode 100644 index 823527a2bc..0000000000 --- a/package/devel/binutils/patches/0001-Do-not-pass-host-compiler-sanitization-flags-on-to-l.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 183eb37e25d903ccd68cc2d8f8a37e75872c03d2 Mon Sep 17 00:00:00 2001 -From: Nick Clifton -Date: Tue, 6 Sep 2016 17:35:35 +0100 -Subject: [PATCH 1/2] Do not pass host compiler sanitization flags on to linker - testsuite. - - * Makefile.am (CFLAGS_FOR_TARGET): Define as a copy of CFLAGS but - without any sanitization options. - (CXXFLAGS_FOR_TARGET): Define as a copy of CXXFLAGS but without - any sanitization options. - (check-DEJAGNU): Pass CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET - as CFLAGS and CXXFLAGS respectively. ---- - ld/Makefile.am | 8 ++++++-- - ld/Makefile.in | 8 ++++++-- - 2 files changed, 12 insertions(+), 4 deletions(-) - ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -136,6 +136,10 @@ CXX_FOR_TARGET = ` \ - fi; \ - fi` - -+# Strip out sanitization options as we want to test building binaries without any extra paraphernalia -+CFLAGS_FOR_TARGET = `echo $(CFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'` -+CXXFLAGS_FOR_TARGET = `echo $(CXXFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'` -+ - transform = s/^ld-new$$/$(installed_linker)/;@program_transform_name@ - bin_PROGRAMS = ld-new - info_TEXINFOS = ld.texinfo -@@ -2075,8 +2079,8 @@ check-DEJAGNU: site.exp - runtest=$(RUNTEST); \ - if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ - $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \ -- CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \ -- CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \ -+ CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS_FOR_TARGET)" \ -+ CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ - CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \ - OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \ - LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -507,6 +507,10 @@ CXX_FOR_TARGET = ` \ - fi; \ - fi` - -+ -+# Strip out sanitization options as they require special host libraries. -+CFLAGS_FOR_TARGET = `echo $(CFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'` -+CXXFLAGS_FOR_TARGET = `echo $(CXXFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'` - info_TEXINFOS = ld.texinfo - ld_TEXINFOS = configdoc.texi - noinst_TEXINFOS = ldint.texinfo -@@ -3644,8 +3648,8 @@ check-DEJAGNU: site.exp - runtest=$(RUNTEST); \ - if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ - $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \ -- CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \ -- CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \ -+ CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS_FOR_TARGET)" \ -+ CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \ - CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \ - OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \ - LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \ diff --git a/package/devel/binutils/patches/0002-When-building-target-binaries-ensure-that-the-warnin.patch b/package/devel/binutils/patches/0002-When-building-target-binaries-ensure-that-the-warnin.patch deleted file mode 100644 index b87c58ec77..0000000000 --- a/package/devel/binutils/patches/0002-When-building-target-binaries-ensure-that-the-warnin.patch +++ /dev/null @@ -1,1258 +0,0 @@ -From b8ff24c72174effd5c5527866313982e28507275 Mon Sep 17 00:00:00 2001 -From: Vlad Zakharov -Date: Mon, 26 Sep 2016 16:36:08 +0100 -Subject: [PATCH 2/2] When building target binaries, ensure that the warning - flags selected for the command line match the target compiler. - -bfd * warning.m4 (AC_EGREP_CPP_FOR_BUILD): Introduce macro - to verify CC_FOR_BUILD compiler. - (AM_BINUTILS_WARNINGS): Introduce ac_cpp_for_build variable - and add CC_FOR_BUILD compiler checks. - * Makefile.in: Regenerate. - * configure: Likewise. - * doc/Makefile.in: Likewise. - -binutils * Makefile.am: Replace AM_CLFAGS with AM_CFLAGS_FOR_BUILD - when building with CC_FOR_BUILD compiler. - * Makefile.in: Regenerate. - * configure: Likewise. - * doc/Makefile.in: Likewise. - -gas * Makefile.in: Regenerate. - * configure: Likewise. - * doc/Makefile.in: Likewise. - -gold * Makefile.in: Regenerate. - * configure: Likewise. - * testsuite/Makefile.in: Likewise. - -gprof * Makefile.in: Regenerate. - * configure: Likewise. - -ld * Makefile.in: Regenerate. - * configure: Likewise. - -opcodes * Makefile.in: Regenerate. - * configure: Likewise. ---- - bfd/Makefile.in | 1 + - bfd/configure | 56 +++++++++++++++++++++++++++++++++++++++++----- - bfd/doc/Makefile.in | 1 + - bfd/warning.m4 | 47 ++++++++++++++++++++++++++++++++++---- - binutils/Makefile.am | 10 +++++---- - binutils/Makefile.in | 10 +++++---- - binutils/configure | 56 +++++++++++++++++++++++++++++++++++++++++----- - binutils/doc/Makefile.in | 1 + - gas/Makefile.in | 1 + - gas/configure | 56 +++++++++++++++++++++++++++++++++++++++++----- - gas/doc/Makefile.in | 1 + - gold/Makefile.in | 5 +++-- - gold/configure | 52 ++++++++++++++++++++++++++++++++++++++---- - gold/testsuite/Makefile.in | 1 + - gprof/Makefile.in | 1 + - gprof/configure | 56 +++++++++++++++++++++++++++++++++++++++++----- - ld/Makefile.in | 3 ++- - ld/configure | 56 +++++++++++++++++++++++++++++++++++++++++----- - opcodes/Makefile.in | 1 + - opcodes/configure | 56 +++++++++++++++++++++++++++++++++++++++++----- - 20 files changed, 416 insertions(+), 55 deletions(-) - ---- a/bfd/Makefile.in -+++ b/bfd/Makefile.in -@@ -288,6 +288,7 @@ TDEFINES = @TDEFINES@ - USE_NLS = @USE_NLS@ - VERSION = @VERSION@ - WARN_CFLAGS = @WARN_CFLAGS@ -+WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ - WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ - XGETTEXT = @XGETTEXT@ - abs_builddir = @abs_builddir@ ---- a/bfd/configure -+++ b/bfd/configure -@@ -659,6 +659,7 @@ MAINTAINER_MODE_FALSE - MAINTAINER_MODE_TRUE - WARN_WRITE_STRINGS - NO_WERROR -+WARN_CFLAGS_FOR_BUILD - WARN_CFLAGS - REPORT_BUGS_TEXI - REPORT_BUGS_TO -@@ -11427,7 +11428,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11430 "configure" -+#line 11431 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11533,7 +11534,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11536 "configure" -+#line 11537 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -12240,8 +12241,12 @@ fi - # Set the 'development' global. - . $srcdir/../bfd/development.sh - -+# Set acp_cpp_for_build variable -+ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" -+ - # Default set of GCC warnings to enable. - GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" -+GCC_WARN_CFLAGS_FOR_BUILD="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" - - # Add -Wshadow if the compiler is a sufficiently recent version of GCC. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -12286,6 +12291,36 @@ fi - rm -f conftest* - - -+# Verify CC_FOR_BUILD to be compatible with waring flags -+ -+# Add -Wshadow if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-3]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" -+fi -+rm -f conftest* -+ -+ -+# Add -Wstack-usage if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-4]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144" -+fi -+rm -f conftest* -+ -+ - # Check whether --enable-werror was given. - if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; case "${enableval}" in -@@ -12301,6 +12336,7 @@ case "${host}" in - *-*-mingw32*) - if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" - fi - ;; - *) ;; -@@ -12314,25 +12350,32 @@ fi - NO_WERROR= - if test "${ERROR_ON_WARNING}" = yes ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" - NO_WERROR="-Wno-error" - fi - - if test "${GCC}" = yes ; then - WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" - fi - - # Check whether --enable-build-warnings was given. - if test "${enable_build_warnings+set}" = set; then : - enableval=$enable_build_warnings; case "${enableval}" in -- yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; -+ yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; - no) if test "${GCC}" = yes ; then - WARN_CFLAGS="-w" -+ WARN_CFLAGS_FOR_BUILD="-w" - fi;; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; -+ WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; -- *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; -+ WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; -+ *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` -+ WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; - esac - fi - -@@ -12343,6 +12386,7 @@ fi - - - -+ - - - ---- a/bfd/doc/Makefile.in -+++ b/bfd/doc/Makefile.in -@@ -248,6 +248,7 @@ TDEFINES = @TDEFINES@ - USE_NLS = @USE_NLS@ - VERSION = @VERSION@ - WARN_CFLAGS = @WARN_CFLAGS@ -+WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ - WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ - XGETTEXT = @XGETTEXT@ - abs_builddir = @abs_builddir@ ---- a/bfd/warning.m4 -+++ b/bfd/warning.m4 -@@ -17,12 +17,34 @@ dnl along with this program; see the fil - dnl . - dnl - -+# AC_EGREP_CPP_FOR_BUILD(PATTERN, PROGRAM, -+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -+# ------------------------------------------------------ -+AC_DEFUN([AC_EGREP_CPP_FOR_BUILD], -+[AC_LANG_PREPROC_REQUIRE()dnl -+AC_REQUIRE([AC_PROG_EGREP])dnl -+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) -+AS_IF([dnl eval is necessary to expand ac_cpp. -+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. -+(eval "$ac_cpp_for_build conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | -+dnl Quote $1 to prevent m4 from eating character classes -+ $EGREP "[$1]" >/dev/null 2>&1], -+ [$3], -+ [$4]) -+rm -f conftest* -+])# AC_EGREP_CPP_FOR_BUILD -+ -+ - AC_DEFUN([AM_BINUTILS_WARNINGS],[ - # Set the 'development' global. - . $srcdir/../bfd/development.sh - -+# Set acp_cpp_for_build variable -+ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" -+ - # Default set of GCC warnings to enable. - GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" -+GCC_WARN_CFLAGS_FOR_BUILD="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" - - # Add -Wshadow if the compiler is a sufficiently recent version of GCC. - AC_EGREP_CPP([^[0-3]$],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wshadow") -@@ -34,6 +56,14 @@ AC_EGREP_CPP([^[0-4]$],[__GNUC__],,GCC_W - WARN_WRITE_STRINGS="" - AC_EGREP_CPP([^[0-3]$],[__GNUC__],,WARN_WRITE_STRINGS="-Wwrite-strings") - -+# Verify CC_FOR_BUILD to be compatible with waring flags -+ -+# Add -Wshadow if the compiler is a sufficiently recent version of GCC. -+AC_EGREP_CPP_FOR_BUILD([^[0-3]$],[__GNUC__],,GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow") -+ -+# Add -Wstack-usage if the compiler is a sufficiently recent version of GCC. -+AC_EGREP_CPP_FOR_BUILD([^[0-4]$],[__GNUC__],,GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144") -+ - AC_ARG_ENABLE(werror, - [ --enable-werror treat compile warnings as errors], - [case "${enableval}" in -@@ -47,6 +77,7 @@ case "${host}" in - *-*-mingw32*) - if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" - fi - ;; - *) ;; -@@ -60,25 +91,32 @@ fi - NO_WERROR= - if test "${ERROR_ON_WARNING}" = yes ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" - NO_WERROR="-Wno-error" - fi - - if test "${GCC}" = yes ; then - WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" - fi - - AC_ARG_ENABLE(build-warnings, - [ --enable-build-warnings enable build-time compiler warnings], - [case "${enableval}" in -- yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; -+ yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; - no) if test "${GCC}" = yes ; then - WARN_CFLAGS="-w" -+ WARN_CFLAGS_FOR_BUILD="-w" - fi;; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; -+ WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; -- *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; -+ WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; -+ *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` -+ WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; - esac]) - - if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then -@@ -86,6 +124,7 @@ if test x"$silent" != x"yes" && test x"$ - fi - - AC_SUBST(WARN_CFLAGS) -+AC_SUBST(WARN_CFLAGS_FOR_BUILD) - AC_SUBST(NO_WERROR) - AC_SUBST(WARN_WRITE_STRINGS) - ]) ---- a/binutils/Makefile.am -+++ b/binutils/Makefile.am -@@ -47,8 +47,10 @@ ZLIB = @zlibdir@ -lz - ZLIBINC = @zlibinc@ - - WARN_CFLAGS = @WARN_CFLAGS@ -+WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ - NO_WERROR = @NO_WERROR@ - AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC) -+AM_CFLAGS_FOR_BUILD = $(WARN_CFLAGS_FOR_BUILD) $(ZLIBINC) - LIBICONV = @LIBICONV@ - - # these two are almost the same program -@@ -305,17 +307,17 @@ sysinfo$(EXEEXT_FOR_BUILD): sysinfo.@OBJ - $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.@OBJEXT@ syslex_wrap.@OBJEXT@ - - syslex_wrap.@OBJEXT@: syslex_wrap.c syslex.c sysinfo.h config.h -- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex_wrap.c -+ $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex_wrap.c - - sysinfo.@OBJEXT@: sysinfo.c - if [ -r sysinfo.c ]; then \ -- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \ -+ $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \ - else \ -- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \ -+ $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \ - fi - - bin2c$(EXEEXT_FOR_BUILD): bin2c.c -- $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c -+ $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c - - embedspu: embedspu.sh Makefile - awk '/^program_transform_name=/ {print "program_transform_name=\"$(program_transform_name)\""; next} {print}' < $< > $@ ---- a/binutils/Makefile.in -+++ b/binutils/Makefile.in -@@ -401,6 +401,7 @@ STRIP = @STRIP@ - USE_NLS = @USE_NLS@ - VERSION = @VERSION@ - WARN_CFLAGS = @WARN_CFLAGS@ -+WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ - WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ - XGETTEXT = @XGETTEXT@ - YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi` -@@ -478,6 +479,7 @@ am__skipyacc = - ZLIB = @zlibdir@ -lz - ZLIBINC = @zlibinc@ - AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC) -+AM_CFLAGS_FOR_BUILD = $(WARN_CFLAGS_FOR_BUILD) $(ZLIBINC) - - # these two are almost the same program - AR_PROG = ar -@@ -1370,17 +1372,17 @@ sysinfo$(EXEEXT_FOR_BUILD): sysinfo.@OBJ - $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.@OBJEXT@ syslex_wrap.@OBJEXT@ - - syslex_wrap.@OBJEXT@: syslex_wrap.c syslex.c sysinfo.h config.h -- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex_wrap.c -+ $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex_wrap.c - - sysinfo.@OBJEXT@: sysinfo.c - if [ -r sysinfo.c ]; then \ -- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \ -+ $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \ - else \ -- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \ -+ $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \ - fi - - bin2c$(EXEEXT_FOR_BUILD): bin2c.c -- $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c -+ $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c - - embedspu: embedspu.sh Makefile - awk '/^program_transform_name=/ {print "program_transform_name=\"$(program_transform_name)\""; next} {print}' < $< > $@ ---- a/binutils/configure -+++ b/binutils/configure -@@ -652,6 +652,7 @@ YFLAGS - YACC - WARN_WRITE_STRINGS - NO_WERROR -+WARN_CFLAGS_FOR_BUILD - WARN_CFLAGS - OTOOL64 - OTOOL -@@ -11225,7 +11226,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11228 "configure" -+#line 11229 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11331,7 +11332,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11334 "configure" -+#line 11335 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11945,8 +11946,12 @@ _ACEOF - # Set the 'development' global. - . $srcdir/../bfd/development.sh - -+# Set acp_cpp_for_build variable -+ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" -+ - # Default set of GCC warnings to enable. - GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" -+GCC_WARN_CFLAGS_FOR_BUILD="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" - - # Add -Wshadow if the compiler is a sufficiently recent version of GCC. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -11991,6 +11996,36 @@ fi - rm -f conftest* - - -+# Verify CC_FOR_BUILD to be compatible with waring flags -+ -+# Add -Wshadow if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-3]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" -+fi -+rm -f conftest* -+ -+ -+# Add -Wstack-usage if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-4]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144" -+fi -+rm -f conftest* -+ -+ - # Check whether --enable-werror was given. - if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; case "${enableval}" in -@@ -12006,6 +12041,7 @@ case "${host}" in - *-*-mingw32*) - if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" - fi - ;; - *) ;; -@@ -12019,25 +12055,32 @@ fi - NO_WERROR= - if test "${ERROR_ON_WARNING}" = yes ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" - NO_WERROR="-Wno-error" - fi - - if test "${GCC}" = yes ; then - WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" - fi - - # Check whether --enable-build-warnings was given. - if test "${enable_build_warnings+set}" = set; then : - enableval=$enable_build_warnings; case "${enableval}" in -- yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; -+ yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; - no) if test "${GCC}" = yes ; then - WARN_CFLAGS="-w" -+ WARN_CFLAGS_FOR_BUILD="-w" - fi;; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; -+ WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; -- *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; -+ WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; -+ *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` -+ WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; - esac - fi - -@@ -12048,6 +12091,7 @@ fi - - - -+ - - - ---- a/binutils/doc/Makefile.in -+++ b/binutils/doc/Makefile.in -@@ -249,6 +249,7 @@ STRIP = @STRIP@ - USE_NLS = @USE_NLS@ - VERSION = @VERSION@ - WARN_CFLAGS = @WARN_CFLAGS@ -+WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ - WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ - XGETTEXT = @XGETTEXT@ - YACC = @YACC@ ---- a/gas/Makefile.in -+++ b/gas/Makefile.in -@@ -255,6 +255,7 @@ STRIP = @STRIP@ - USE_NLS = @USE_NLS@ - VERSION = @VERSION@ - WARN_CFLAGS = @WARN_CFLAGS@ @WARN_WRITE_STRINGS@ -+WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ - WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ - XGETTEXT = @XGETTEXT@ - YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi` ---- a/gas/configure -+++ b/gas/configure -@@ -642,6 +642,7 @@ cgen_cpu_prefix - GDBINIT - WARN_WRITE_STRINGS - NO_WERROR -+WARN_CFLAGS_FOR_BUILD - WARN_CFLAGS - OTOOL64 - OTOOL -@@ -10985,7 +10986,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 10988 "configure" -+#line 10989 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11091,7 +11092,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11094 "configure" -+#line 11095 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11721,8 +11722,12 @@ using_cgen=no - # Set the 'development' global. - . $srcdir/../bfd/development.sh - -+# Set acp_cpp_for_build variable -+ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" -+ - # Default set of GCC warnings to enable. - GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" -+GCC_WARN_CFLAGS_FOR_BUILD="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" - - # Add -Wshadow if the compiler is a sufficiently recent version of GCC. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -11767,6 +11772,36 @@ fi - rm -f conftest* - - -+# Verify CC_FOR_BUILD to be compatible with waring flags -+ -+# Add -Wshadow if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-3]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" -+fi -+rm -f conftest* -+ -+ -+# Add -Wstack-usage if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-4]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144" -+fi -+rm -f conftest* -+ -+ - # Check whether --enable-werror was given. - if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; case "${enableval}" in -@@ -11782,6 +11817,7 @@ case "${host}" in - *-*-mingw32*) - if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" - fi - ;; - *) ;; -@@ -11795,25 +11831,32 @@ fi - NO_WERROR= - if test "${ERROR_ON_WARNING}" = yes ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" - NO_WERROR="-Wno-error" - fi - - if test "${GCC}" = yes ; then - WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" - fi - - # Check whether --enable-build-warnings was given. - if test "${enable_build_warnings+set}" = set; then : - enableval=$enable_build_warnings; case "${enableval}" in -- yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; -+ yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; - no) if test "${GCC}" = yes ; then - WARN_CFLAGS="-w" -+ WARN_CFLAGS_FOR_BUILD="-w" - fi;; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; -+ WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; -- *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; -+ WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; -+ *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` -+ WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; - esac - fi - -@@ -11824,6 +11867,7 @@ fi - - - -+ - - - ---- a/gas/doc/Makefile.in -+++ b/gas/doc/Makefile.in -@@ -230,6 +230,7 @@ STRIP = @STRIP@ - USE_NLS = @USE_NLS@ - VERSION = @VERSION@ - WARN_CFLAGS = @WARN_CFLAGS@ -+WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ - WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ - XGETTEXT = @XGETTEXT@ - YACC = @YACC@ ---- a/gold/Makefile.in -+++ b/gold/Makefile.in -@@ -87,8 +87,8 @@ subdir = . - DIST_COMMON = NEWS README ChangeLog $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(srcdir)/config.in \ -- $(srcdir)/../mkinstalldirs $(top_srcdir)/po/Make-in \ -- ftruncate.c pread.c mremap.c ffsll.c yyscript.h yyscript.c \ -+ $(srcdir)/../mkinstalldirs $(top_srcdir)/po/Make-in ffsll.c \ -+ mremap.c ftruncate.c pread.c yyscript.h yyscript.c \ - $(srcdir)/../depcomp $(srcdir)/../ylwrap - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 - am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ -@@ -409,6 +409,7 @@ TARGETOBJS = @TARGETOBJS@ - USE_NLS = @USE_NLS@ - VERSION = @VERSION@ - WARN_CFLAGS = @WARN_CFLAGS@ -+WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ - WARN_CXXFLAGS = @WARN_CXXFLAGS@ - WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ - XGETTEXT = @XGETTEXT@ ---- a/gold/configure -+++ b/gold/configure -@@ -609,6 +609,7 @@ GOLD_LDFLAGS - WARN_CXXFLAGS - WARN_WRITE_STRINGS - NO_WERROR -+WARN_CFLAGS_FOR_BUILD - WARN_CFLAGS - IFUNC_STATIC_FALSE - IFUNC_STATIC_TRUE -@@ -6723,8 +6724,12 @@ fi - # Set the 'development' global. - . $srcdir/../bfd/development.sh - -+# Set acp_cpp_for_build variable -+ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" -+ - # Default set of GCC warnings to enable. - GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" -+GCC_WARN_CFLAGS_FOR_BUILD="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" - - # Add -Wshadow if the compiler is a sufficiently recent version of GCC. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -6769,6 +6774,36 @@ fi - rm -f conftest* - - -+# Verify CC_FOR_BUILD to be compatible with waring flags -+ -+# Add -Wshadow if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-3]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" -+fi -+rm -f conftest* -+ -+ -+# Add -Wstack-usage if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-4]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144" -+fi -+rm -f conftest* -+ -+ - # Check whether --enable-werror was given. - if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; case "${enableval}" in -@@ -6784,6 +6819,7 @@ case "${host}" in - *-*-mingw32*) - if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" - fi - ;; - *) ;; -@@ -6797,25 +6833,32 @@ fi - NO_WERROR= - if test "${ERROR_ON_WARNING}" = yes ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" - NO_WERROR="-Wno-error" - fi - - if test "${GCC}" = yes ; then - WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" - fi - - # Check whether --enable-build-warnings was given. - if test "${enable_build_warnings+set}" = set; then : - enableval=$enable_build_warnings; case "${enableval}" in -- yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; -+ yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; - no) if test "${GCC}" = yes ; then - WARN_CFLAGS="-w" -+ WARN_CFLAGS_FOR_BUILD="-w" - fi;; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; -+ WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; -- *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; -+ WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; -+ *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` -+ WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; - esac - fi - -@@ -6826,6 +6869,7 @@ fi - - - -+ - - - ---- a/gold/testsuite/Makefile.in -+++ b/gold/testsuite/Makefile.in -@@ -2568,6 +2568,7 @@ TARGETOBJS = @TARGETOBJS@ - USE_NLS = @USE_NLS@ - VERSION = @VERSION@ - WARN_CFLAGS = @WARN_CFLAGS@ -+WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ - WARN_CXXFLAGS = @WARN_CXXFLAGS@ - WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ - XGETTEXT = @XGETTEXT@ ---- a/gprof/Makefile.in -+++ b/gprof/Makefile.in -@@ -267,6 +267,7 @@ STRIP = @STRIP@ - USE_NLS = @USE_NLS@ - VERSION = @VERSION@ - WARN_CFLAGS = @WARN_CFLAGS@ -+WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ - WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ - XGETTEXT = @XGETTEXT@ - abs_builddir = @abs_builddir@ ---- a/gprof/configure -+++ b/gprof/configure -@@ -604,6 +604,7 @@ LTLIBOBJS - LIBOBJS - WARN_WRITE_STRINGS - NO_WERROR -+WARN_CFLAGS_FOR_BUILD - WARN_CFLAGS - GENINSRC_NEVER_FALSE - GENINSRC_NEVER_TRUE -@@ -10901,7 +10902,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 10904 "configure" -+#line 10905 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11007,7 +11008,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11010 "configure" -+#line 11011 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -12101,8 +12102,12 @@ fi - # Set the 'development' global. - . $srcdir/../bfd/development.sh - -+# Set acp_cpp_for_build variable -+ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" -+ - # Default set of GCC warnings to enable. - GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" -+GCC_WARN_CFLAGS_FOR_BUILD="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" - - # Add -Wshadow if the compiler is a sufficiently recent version of GCC. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -12147,6 +12152,36 @@ fi - rm -f conftest* - - -+# Verify CC_FOR_BUILD to be compatible with waring flags -+ -+# Add -Wshadow if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-3]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" -+fi -+rm -f conftest* -+ -+ -+# Add -Wstack-usage if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-4]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144" -+fi -+rm -f conftest* -+ -+ - # Check whether --enable-werror was given. - if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; case "${enableval}" in -@@ -12162,6 +12197,7 @@ case "${host}" in - *-*-mingw32*) - if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" - fi - ;; - *) ;; -@@ -12175,25 +12211,32 @@ fi - NO_WERROR= - if test "${ERROR_ON_WARNING}" = yes ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" - NO_WERROR="-Wno-error" - fi - - if test "${GCC}" = yes ; then - WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" - fi - - # Check whether --enable-build-warnings was given. - if test "${enable_build_warnings+set}" = set; then : - enableval=$enable_build_warnings; case "${enableval}" in -- yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; -+ yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; - no) if test "${GCC}" = yes ; then - WARN_CFLAGS="-w" -+ WARN_CFLAGS_FOR_BUILD="-w" - fi;; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; -+ WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; -- *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; -+ WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; -+ *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` -+ WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; - esac - fi - -@@ -12204,6 +12247,7 @@ fi - - - -+ - - - ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -354,6 +354,7 @@ TESTBFDLIB = @TESTBFDLIB@ - USE_NLS = @USE_NLS@ - VERSION = @VERSION@ - WARN_CFLAGS = @WARN_CFLAGS@ -+WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ - WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ - XGETTEXT = @XGETTEXT@ - YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi` -@@ -508,7 +509,7 @@ CXX_FOR_TARGET = ` \ - fi` - - --# Strip out sanitization options as they require special host libraries. -+# Strip out sanitization options as we want to test building binaries without any extra paraphernalia - CFLAGS_FOR_TARGET = `echo $(CFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'` - CXXFLAGS_FOR_TARGET = `echo $(CXXFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'` - info_TEXINFOS = ld.texinfo ---- a/ld/configure -+++ b/ld/configure -@@ -646,6 +646,7 @@ LIBINTL - USE_NLS - WARN_WRITE_STRINGS - NO_WERROR -+WARN_CFLAGS_FOR_BUILD - WARN_CFLAGS - installed_linker - install_as_default -@@ -11723,7 +11724,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11726 "configure" -+#line 11727 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11829,7 +11830,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11832 "configure" -+#line 11833 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -15558,8 +15559,12 @@ fi - # Set the 'development' global. - . $srcdir/../bfd/development.sh - -+# Set acp_cpp_for_build variable -+ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" -+ - # Default set of GCC warnings to enable. - GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" -+GCC_WARN_CFLAGS_FOR_BUILD="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" - - # Add -Wshadow if the compiler is a sufficiently recent version of GCC. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -15604,6 +15609,36 @@ fi - rm -f conftest* - - -+# Verify CC_FOR_BUILD to be compatible with waring flags -+ -+# Add -Wshadow if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-3]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" -+fi -+rm -f conftest* -+ -+ -+# Add -Wstack-usage if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-4]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144" -+fi -+rm -f conftest* -+ -+ - # Check whether --enable-werror was given. - if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; case "${enableval}" in -@@ -15619,6 +15654,7 @@ case "${host}" in - *-*-mingw32*) - if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" - fi - ;; - *) ;; -@@ -15632,25 +15668,32 @@ fi - NO_WERROR= - if test "${ERROR_ON_WARNING}" = yes ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" - NO_WERROR="-Wno-error" - fi - - if test "${GCC}" = yes ; then - WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" - fi - - # Check whether --enable-build-warnings was given. - if test "${enable_build_warnings+set}" = set; then : - enableval=$enable_build_warnings; case "${enableval}" in -- yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; -+ yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; - no) if test "${GCC}" = yes ; then - WARN_CFLAGS="-w" -+ WARN_CFLAGS_FOR_BUILD="-w" - fi;; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; -+ WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; -- *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; -+ WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; -+ *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` -+ WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; - esac - fi - -@@ -15661,6 +15704,7 @@ fi - - - -+ - - - ---- a/opcodes/Makefile.in -+++ b/opcodes/Makefile.in -@@ -267,6 +267,7 @@ STRIP = @STRIP@ - USE_NLS = @USE_NLS@ - VERSION = @VERSION@ - WARN_CFLAGS = @WARN_CFLAGS@ -+WARN_CFLAGS_FOR_BUILD = @WARN_CFLAGS_FOR_BUILD@ - WARN_WRITE_STRINGS = @WARN_WRITE_STRINGS@ - XGETTEXT = @XGETTEXT@ - abs_builddir = @abs_builddir@ ---- a/opcodes/configure -+++ b/opcodes/configure -@@ -643,6 +643,7 @@ MAINTAINER_MODE_TRUE - NO_WMISSING_FIELD_INITIALIZERS - WARN_WRITE_STRINGS - NO_WERROR -+WARN_CFLAGS_FOR_BUILD - WARN_CFLAGS - OTOOL64 - OTOOL -@@ -11150,7 +11151,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11153 "configure" -+#line 11154 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11256,7 +11257,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11259 "configure" -+#line 11260 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11508,8 +11509,12 @@ fi - # Set the 'development' global. - . $srcdir/../bfd/development.sh - -+# Set acp_cpp_for_build variable -+ac_cpp_for_build="$CC_FOR_BUILD -E $CPPFLAGS_FOR_BUILD" -+ - # Default set of GCC warnings to enable. - GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" -+GCC_WARN_CFLAGS_FOR_BUILD="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" - - # Add -Wshadow if the compiler is a sufficiently recent version of GCC. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -11554,6 +11559,36 @@ fi - rm -f conftest* - - -+# Verify CC_FOR_BUILD to be compatible with waring flags -+ -+# Add -Wshadow if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-3]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow" -+fi -+rm -f conftest* -+ -+ -+# Add -Wstack-usage if the compiler is a sufficiently recent version of GCC. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+__GNUC__ -+_ACEOF -+if (eval "$ac_cpp_for_build conftest.$ac_ext") 2>&5 | -+ $EGREP "^[0-4]$" >/dev/null 2>&1; then : -+ -+else -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144" -+fi -+rm -f conftest* -+ -+ - # Check whether --enable-werror was given. - if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; case "${enableval}" in -@@ -11569,6 +11604,7 @@ case "${host}" in - *-*-mingw32*) - if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wno-format" - fi - ;; - *) ;; -@@ -11582,25 +11618,32 @@ fi - NO_WERROR= - if test "${ERROR_ON_WARNING}" = yes ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" -+ GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Werror" - NO_WERROR="-Wno-error" - fi - - if test "${GCC}" = yes ; then - WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}" - fi - - # Check whether --enable-build-warnings was given. - if test "${enable_build_warnings+set}" = set; then : - enableval=$enable_build_warnings; case "${enableval}" in -- yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; -+ yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD}";; - no) if test "${GCC}" = yes ; then - WARN_CFLAGS="-w" -+ WARN_CFLAGS_FOR_BUILD="-w" - fi;; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; -+ WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}" -+ WARN_CFLAGS_FOR_BUILD="${GCC_WARN_CFLAGS_FOR_BUILD} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` -- WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; -- *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; -+ WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}" -+ WARN_CFLAGS_FOR_BUILD="${t} ${GCC_WARN_CFLAGS_FOR_BUILD}";; -+ *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"` -+ WARN_CFLAGS_FOR_BUILD=`echo "${enableval}" | sed -e "s/,/ /g"`;; - esac - fi - -@@ -11611,6 +11654,7 @@ fi - - - -+ - - - ac_ext=c From 6e2ad20a00b3786d870e0841b703e655e8bbebd4 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 6 Aug 2020 12:53:14 +0200 Subject: [PATCH 07/19] build: set up host command for egrep It is used for the kernel build and uses GNU specific features Signed-off-by: Felix Fietkau --- include/prereq-build.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 83dad0f2dc..4637c6ca50 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -114,6 +114,10 @@ $(eval $(call SetupHostCommand,grep,Please install GNU 'grep', \ ggrep --version 2>&1 | grep GNU, \ grep --version 2>&1 | grep GNU)) +$(eval $(call SetupHostCommand,egrep,Please install GNU 'grep', \ + gegrep --version 2>&1 | grep GNU, \ + egrep --version 2>&1 | grep GNU)) + $(eval $(call SetupHostCommand,getopt, \ Please install an extended getopt version that supports --long, \ gnugetopt -o t --long test -- --test | grep '^ *--test *--', \ From 1ca1f4d6723f4dbcb24ebaca9c15ac1dc23ee146 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Thu, 6 Aug 2020 13:41:00 +0200 Subject: [PATCH 08/19] glibc: update to latest 2.31 commit [BZ #19519 BZ #26332 BZ #26248] 6fdf971c9d Add NEWS entry for CVE-2016-10228 (bug 19519) 70d585151c Rewrite iconv option parsing [BZ #19519] 1c8efe848b powerpc: Fix incorrect cache line size load in memset (bug 26332) 7611339a9b nptl: Zero-extend arguments to SETXID syscalls [BZ #26248] 21b760cc2f Disable warnings due to deprecated libselinux symbols used by nss and nscd Signed-off-by: Hans Dedecker --- toolchain/glibc/common.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index 9a9c4a5343..6b3f15b129 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -12,8 +12,8 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=6f3459f9859a7b506c64fa1823769ab631072c6e -PKG_MIRROR_HASH:=01ed0c8131bdc32c9abd3aaaebc4fcffb2d496c2b8c363a0e845ac09d874a2ff +PKG_SOURCE_VERSION:=6fdf971c9dbf7dac9bea552113fe4694015bbc4d +PKG_MIRROR_HASH:=80998023c237bd0eaa38554e18536d8f66223e97fc5ade015a2d2aadf587d1f0 PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz From bcb17410475c83caebb43dbcd8f6b86278059d8c Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 6 Aug 2020 16:16:02 +0100 Subject: [PATCH 09/19] procd: update to git HEAD 47a9f0d service: add method to query available container features afbaba9 initd: attempt to mount cgroup2 ead60fe jail: use pidns semantics also for timens 759e9f8 jail: make use of BLOBMSG_CAST_INT64 for OCI rlimits 83053b6 instance: add instances into unified cgroup hierarchy 16159bb jail: parse OCI cgroups resources 282ff0c jail: only free cgroups if they were allocated ab55357 jail: fix freeing cgroups avl Signed-off-by: Daniel Golle --- package/system/procd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 4373149ff9..ba4af81a1a 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_SOURCE_DATE:=2020-07-30 -PKG_SOURCE_VERSION:=2ae5cbcf1d4509837a16eceafca374e9bf0ea850 -PKG_MIRROR_HASH:=479d4a4bfb71ef54300e7b669846e596db7792566302b4d29e3265643d89bce3 +PKG_SOURCE_DATE:=2020-08-06 +PKG_SOURCE_VERSION:=ab55357dfe5bd0edac0b9556a83e69814df791b1 +PKG_MIRROR_HASH:=38c882e105811bcd10b5ce55f91a16a647ed2ad436aec01cd03fda588b7bfca9 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 208fd5d90a5549e4301c0e449ec70c4db1c37f1f Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Thu, 6 Aug 2020 22:10:32 +0200 Subject: [PATCH 10/19] tools/firmware-utils: use UTC for image timestamps By using localtime() to determine the timestamp that goes into factory images, the resulting image depends on the timezone of the build system. Use gmtime() instead, which results in more reproducible images. Signed-off-by: Sander Vanheule --- tools/firmware-utils/Makefile | 2 +- tools/firmware-utils/src/addpattern.c | 2 +- tools/firmware-utils/src/tplink-safeloader.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index ee0ef3a6fd..4fcda7e439 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME := firmware-utils -PKG_RELEASE := 1 +PKG_RELEASE := 2 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/kernel.mk diff --git a/tools/firmware-utils/src/addpattern.c b/tools/firmware-utils/src/addpattern.c index 9bc4865335..9791527878 100644 --- a/tools/firmware-utils/src/addpattern.c +++ b/tools/firmware-utils/src/addpattern.c @@ -296,7 +296,7 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - ptm = localtime(&t); + ptm = gmtime(&t); if (3 != sscanf(version, "v%d.%d.%d", &v0, &v1, &v2)) { fprintf(stderr, "bad version string \"%s\"\n", version); diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index 3f83f19d2d..69e499bfba 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -2035,7 +2035,7 @@ static struct image_partition_entry make_soft_version(uint32_t rev) { else if (time(&t) == (time_t)(-1)) error(1, errno, "time"); - struct tm *tm = localtime(&t); + struct tm *tm = gmtime(&t); s->magic = htonl(0x0000000c); s->zero = 0; From 0fd214533d6a17ba99511fc62c5ededda9923df2 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 4 Aug 2020 12:00:22 +0800 Subject: [PATCH 11/19] dnsmasq: abort when dnssec requested but not available Before this commit, if uci option "dnssec" was set, we pass "--dnssec" and friends to dnsmasq, let it start and decide whether to quit and whether to emit message for diagnosis # dnsmasq --dnssec; echo $? dnsmasq: DNSSEC not available: set HAVE_DNSSEC in src/config.h 1 DNSSEC as a feature is different from others like dhcp, tftp in that it's a security feature. Better be explicit. With this change committed, we make it so by not allowing it in the first in the initscript, should dnsmasq later decides to not quit (not likely) or quit without above explicit error (unlikely but less so ;) So this is just being proactive. on/off choices with uci option "dnssec" are still available like before Link: https://github.com/openwrt/openwrt/pull/3265#issuecomment-667795302 Signed-off-by: Yousong Zhou --- package/network/services/dnsmasq/Makefile | 2 +- package/network/services/dnsmasq/files/dnsmasq.init | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 12bf991a36..059481b185 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_VERSION:=2.82 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index c26433563e..2436c848c3 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -42,9 +42,13 @@ dnsmasq_ignore_opt() { bootp-*|\ pxe-*) [ -z "$dnsmasq_has_dhcp" ] ;; - dnssec-*|\ + dnssec*|\ trust-anchor) - [ -z "$dnsmasq_has_dnssec" ] ;; + if [ -z "$dnsmasq_has_dnssec" ]; then + echo "dnsmasq: \"$opt\" requested, but dnssec support is not available" >&2 + exit 1 + fi + ;; tftp-*) [ -z "$dnsmasq_has_tftp" ] ;; ipset) From 40e122d59b3e9365cda4c55882d962bccaf8d354 Mon Sep 17 00:00:00 2001 From: Tobias Welz Date: Mon, 3 Aug 2020 21:39:43 +0200 Subject: [PATCH 12/19] ramips: disable unused phy ports of WizFi630S WIZnet WizFi630S is using only 3 of the phy ports. The unused phy ports draw unnecessarily power. This is disabling the unused phy ports. Signed-off-by: Tobias Welz --- target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts b/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts index c3a37fad47..a51fe06755 100644 --- a/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts +++ b/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts @@ -172,6 +172,7 @@ &esw { mediatek,portmap = <0x3e>; + mediatek,portdisable = <0x26>; }; &sdhci { From 00668433f5f7643bfc3760b6ffeabef0f07bf05b Mon Sep 17 00:00:00 2001 From: Tobias Welz Date: Mon, 3 Aug 2020 21:29:25 +0200 Subject: [PATCH 13/19] ramips: remove doublet entry in WizFi630S dts file &wmac entry in WIZnet WizFi630S dts file was existing two times. This is removing one of them. Signed-off-by: Tobias Welz --- target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts b/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts index a51fe06755..dfebfd8d3e 100644 --- a/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts +++ b/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts @@ -106,10 +106,6 @@ }; }; -&wmac { - status = "okay"; -}; - &spi0 { status = "okay"; From 3a8faed93dd5ee78bb8089338e22642ea3f6f1e6 Mon Sep 17 00:00:00 2001 From: Tobias Welz Date: Mon, 3 Aug 2020 21:28:31 +0200 Subject: [PATCH 14/19] ramips: enable flashing WizFi630S via OEM firmware WIZnet WizFi630s board name is written slightly different it its OEM OpenWrt firmware. This causes an incompatibility warning during flashing with sysupgrade. This patch is adding the vendor board name to the supported devices list to avoid this warning. For initial flashing you can use sysupgrade via command line or luci beside of TFTP. Do not keep the OEM configuration during sysupgrade. Signed-off-by: Tobias Welz --- target/linux/ramips/image/mt76x8.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index d140184d81..7cc792b2aa 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -538,6 +538,7 @@ define Device/wiznet_wizfi630s IMAGE_SIZE := 32448k DEVICE_VENDOR := WIZnet DEVICE_MODEL := WizFi630S + SUPPORTED_DEVICES += wizfi630s endef TARGET_DEVICES += wiznet_wizfi630s From f37d0b447f4c461c34397b1068c9ff086d17c40e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 22 Jun 2020 21:44:37 +0200 Subject: [PATCH 15/19] build: make prefix mapping of debug information optional Remapping the local build path in debug information makes debugging using ./scripts/remote-gdb harder, because files no longer refer to the full path on the build host. For local builds, debug information does not need to be reproducible, since it will be stripped out of packages anyway. For buildbot builds, it makes sense to keep debug information reproducible, since the full path is not needed (nor desired) anywhere. Signed-off-by: Felix Fietkau --- config/Config-build.in | 9 +++++++++ rules.mk | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config/Config-build.in b/config/Config-build.in index 8c6271124a..f81e4e2ea9 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -85,6 +85,15 @@ menu "Global build settings" help If enabled, config.seed will be stored in /etc/build.config of firmware. + config REPRODUCIBLE_DEBUG_INFO + bool "Make debug information reproducible" + default BUILDBOT + help + This strips the local build path out of debug information. This has the + advantage of making it reproducible, but the disadvantage of making local + debugging using ./scripts/remote-gdb harder, since the debug data will + no longer point to the full path on the build host. + config COLLECT_KERNEL_DEBUG bool prompt "Collect kernel debug information" diff --git a/rules.mk b/rules.mk index ef187a0348..9dcb74947a 100644 --- a/rules.mk +++ b/rules.mk @@ -144,7 +144,7 @@ ifeq ($(or $(CONFIG_EXTERNAL_TOOLCHAIN),$(CONFIG_TARGET_uml)),) ifeq ($(CONFIG_GCC_USE_IREMAP),y) iremap = -iremap$(1):$(2) else - iremap = -ffile-prefix-map=$(1)=$(2) + iremap = -f$(if $(CONFIG_REPRODUCIBLE_DEBUG_INFO),file,macro)-prefix-map=$(1)=$(2) endif endif From 0dc0b8e582b9c7d82c9f5a863921e73b6acd90b5 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 5 Aug 2020 09:25:41 +0200 Subject: [PATCH 16/19] openvpn: fix arguments passing to wrapped up and down scripts With the introduction of the generic OpenVPN hotplug mechanism, wrapped --up and --down scripts got the wrong amount and order of arguments passed, breaking existing configurations and functionality. Fix this issue by passing the same amount of arguments in the same expected order as if the scripts were executed by the OpenVPN daemon directly. Ref: https://github.com/openwrt/openwrt/pull/1596#issuecomment-668935156 Fixes: 8fe9940db6 ("openvpn: add generic hotplug mechanism") Signed-off-by: Jo-Philipp Wich --- package/network/services/openvpn/Makefile | 7 +- .../files/etc/hotplug.d/openvpn/01-user | 18 +--- .../openvpn/files/lib/functions/openvpn.sh | 16 ++++ .../services/openvpn/files/openvpn.config | 83 +++++++++++++++++-- .../services/openvpn/files/openvpn.init | 37 ++++++++- 5 files changed, 137 insertions(+), 24 deletions(-) create mode 100644 package/network/services/openvpn/files/lib/functions/openvpn.sh diff --git a/package/network/services/openvpn/Makefile b/package/network/services/openvpn/Makefile index f1170bbd37..9482e9ce39 100644 --- a/package/network/services/openvpn/Makefile +++ b/package/network/services/openvpn/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn PKG_VERSION:=2.4.9 -PKG_RELEASE:=2 +PKG_RELEASE:=4 PKG_SOURCE_URL:=\ https://build.openvpn.net/downloads/releases/ \ @@ -112,6 +112,7 @@ define Package/openvpn-$(BUILD_VARIANT)/install $(1)/etc/init.d \ $(1)/etc/config \ $(1)/etc/openvpn \ + $(1)/lib/functions \ $(1)/lib/upgrade/keep.d \ $(1)/usr/libexec \ $(1)/etc/hotplug.d/openvpn @@ -128,6 +129,10 @@ define Package/openvpn-$(BUILD_VARIANT)/install files/usr/libexec/openvpn-hotplug \ $(1)/usr/libexec/openvpn-hotplug + $(INSTALL_DATA) \ + files/lib/functions/openvpn.sh \ + $(1)/lib/functions/openvpn.sh + $(INSTALL_DATA) \ files/etc/hotplug.d/openvpn/01-user \ $(1)/etc/hotplug.d/openvpn/01-user diff --git a/package/network/services/openvpn/files/etc/hotplug.d/openvpn/01-user b/package/network/services/openvpn/files/etc/hotplug.d/openvpn/01-user index 6d45f0b7c6..f93823e5c5 100644 --- a/package/network/services/openvpn/files/etc/hotplug.d/openvpn/01-user +++ b/package/network/services/openvpn/files/etc/hotplug.d/openvpn/01-user @@ -1,17 +1,6 @@ #!/bin/sh -get_option() { - local variable="$1" - local option="$2" - - local value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+(([^ \t\\]|\\.)+)[ \t]*$/\1/p' "$config" | tail -n1 | sed -re 's/\\(.)/\1/g')" - [ -n "$value" ] || value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+'"'([^']+)'"'[ \t]*$/\1/p' "$config" | tail -n1)" - [ -n "$value" ] || value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+"(([^"\\]|\\.)+)"[ \t]*$/\1/p' "$config" | tail -n1 | sed -re 's/\\(.)/\1/g')" - [ -n "$value" ] || return 1 - - export -n "$variable=$value" - return 0 -} +. /lib/functions/openvpn.sh [ -e "/etc/openvpn.user" ] && { env -i ACTION="$ACTION" INSTANCE="$INSTANCE" \ @@ -23,8 +12,9 @@ get_option() { # Wrap user defined scripts on up/down events case "$ACTION" in up|down) - if get_option command "$ACTION"; then - exec /bin/sh -c "$command $ACTION $INSTANCE $*" + if get_openvpn_option "$config" command "$ACTION"; then + shift + exec /bin/sh -c "$command $*" fi ;; esac diff --git a/package/network/services/openvpn/files/lib/functions/openvpn.sh b/package/network/services/openvpn/files/lib/functions/openvpn.sh new file mode 100644 index 0000000000..83fb1bb453 --- /dev/null +++ b/package/network/services/openvpn/files/lib/functions/openvpn.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +get_openvpn_option() { + local config="$1" + local variable="$2" + local option="$3" + + local value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+(([^ \t\\]|\\.)+)[ \t]*$/\1/p' "$config" | tail -n1 | sed -re 's/\\(.)/\1/g')" + [ -n "$value" ] || value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+'"'([^']+)'"'[ \t]*$/\1/p' "$config" | tail -n1)" + [ -n "$value" ] || value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+"(([^"\\]|\\.)+)"[ \t]*$/\1/p' "$config" | tail -n1 | sed -re 's/\\(.)/\1/g')" + [ -n "$value" ] || return 1 + + export -n "$variable=$value" + return 0 +} + diff --git a/package/network/services/openvpn/files/openvpn.config b/package/network/services/openvpn/files/openvpn.config index 1fd846f558..3de1881e35 100644 --- a/package/network/services/openvpn/files/openvpn.config +++ b/package/network/services/openvpn/files/openvpn.config @@ -77,10 +77,10 @@ config openvpn sample_server # Diffie hellman parameters. # Generate your own with: - # openssl dhparam -out dh1024.pem 1024 + # openssl dhparam -out dh2048.pem 2048 # Substitute 2048 for 1024 if you are using - # 2048 bit keys. - option dh /etc/openvpn/dh1024.pem + # 1024 bit keys. + option dh /etc/openvpn/dh2048.pem # Configure server mode and supply a VPN subnet # for OpenVPN to draw client addresses from. @@ -228,10 +228,52 @@ config openvpn sample_server # This file is secret: # option tls_auth "/etc/openvpn/ta.key 0" + # For additional privacy, a shared secret key + # can be used for both authentication (as in tls_auth) + # and encryption of the TLS control channel. + # + # Generate a shared secret with: + # openvpn --genkey --secret ta.key + # + # The server and each client must have + # a copy of this key. + # + # tls_auth and tls_crypt should NOT + # be combined, as tls_crypt implies tls_auth. + # Use EITHER tls_crypt, tls_auth, or neither option. +# option tls_crypt "/etc/openvpn/ta.key" + + # Set the minimum required TLS protocol version + # for all connections. + # + # Require at least TLS 1.1 +# option tls_version_min "1.1" + # Require at least TLS 1.2 +# option tls_version_min "1.2" + # Require TLS 1.2, or the highest version supported + # on the system +# option tls_version_min "1.2 'or-highest'" + + # OpenVPN versions 2.4 and later will attempt to + # automatically negotiate the most secure cipher + # between the client and server, regardless of a + # configured "option cipher" (see below). + # Automatic negotiation is recommended. + # + # Uncomment this option to disable this behavior, + # and force all OpenVPN peers to use the configured + # cipher option instead (not recommended). +# option ncp_disable + # Select a cryptographic cipher. # This config item must be copied to # the client config file as well. - # Blowfish (default): + # + # To see all supported ciphers, run: + # openvpn --show-ciphers + # + # Blowfish (default for backwards compatibility, + # but not recommended due to weaknesses): # option cipher BF-CBC # AES: # option cipher AES-128-CBC @@ -241,11 +283,16 @@ config openvpn sample_server # Enable compression on the VPN link. # If you enable it here, you must also # enable it in the client config file. + # + # Compression is not recommended, as compression and + # encryption in combination can weaken the security + # of the connection. + # # LZ4 requires OpenVPN 2.4+ client and server # option compress lz4 # LZO is compatible with most OpenVPN versions # (set "compress lzo" on 2.4+ clients, and "comp-lzo yes" on older clients) - option compress lzo +# option compress lzo # The maximum number of concurrently connected # clients we want to allow. @@ -371,7 +418,7 @@ config openvpn sample_client option key /etc/openvpn/client.key # Verify server certificate by checking - # that the certicate has the nsCertType + # that the certicate has the key usage # field set to "server". This is an # important precaution to protect against # a potential attack discussed here: @@ -381,12 +428,27 @@ config openvpn sample_client # your server certificates with the nsCertType # field set to "server". The build_key_server # script in the easy_rsa folder will do this. -# option ns_cert_type server +# option remote_cert_tls server # If a tls_auth key is used on the server # then every client must also have the key. # option tls_auth "/etc/openvpn/ta.key 1" + # If a tls_crypt key is used on the server + # every client must also have the key. +# option tls_crypt "/etc/openvpn/ta.key" + + # Set the minimum required TLS protocol version + # for all connections. + # + # Require at least TLS 1.1 +# option tls_version_min "1.1" + # Require at least TLS 1.2 +# option tls_version_min "1.2" + # Require TLS 1.2, or the highest version supported + # on the system +# option tls_version_min "1.2 'or-highest'" + # Select a cryptographic cipher. # If the cipher option is used on the server # then you must also specify it here. @@ -395,10 +457,15 @@ config openvpn sample_client # Enable compression on the VPN link. # Don't enable this unless it is also # enabled in the server config file. + # + # Compression is not recommended, as compression and + # encryption in combination can weaken the security + # of the connection. + # # LZ4 requires OpenVPN 2.4+ on server and client # option compress lz4 # LZO is compatible with most OpenVPN versions - option compress lzo +# option compress lzo # Set log file verbosity. option verb 3 diff --git a/package/network/services/openvpn/files/openvpn.init b/package/network/services/openvpn/files/openvpn.init index a560b89ff2..a454eb4ba0 100644 --- a/package/network/services/openvpn/files/openvpn.init +++ b/package/network/services/openvpn/files/openvpn.init @@ -69,6 +69,40 @@ section_enabled() { [ $enable -gt 0 ] || [ $enabled -gt 0 ] } +openvpn_get_dev() { + local dev dev_type + local name="$1" + local conf="$2" + + # Do override only for configurations with config_file + config_get config_file "$name" config + [ -n "$config_file" ] || return + + # Check there is someething to override + config_get dev "$name" dev + config_get dev_type "$name" dev_type + [ -n "$dev" ] || return + + # If there is a no dev_type, try to guess it + if [ -z "$dev_type" ]; then + . /lib/functions/openvpn.sh + + local odev odev_type + get_openvpn_option "$conf" odev dev + get_openvpn_option "$conf" odev_type dev-type + [ -n "$odev_type" ] || odev_type="$odev" + + case "$odev_type" in + tun*) dev_type="tun" ;; + tap*) dev_type="tap" ;; + *) return;; + esac + fi + + # Return overrides + echo "--dev-type $dev_type --dev $dev" +} + openvpn_add_instance() { local name="$1" local dir="$2" @@ -83,7 +117,8 @@ openvpn_add_instance() { --config "$conf" \ --up "/usr/libexec/openvpn-hotplug up $name" \ --down "/usr/libexec/openvpn-hotplug down $name" \ - --script-security "${security:-2}" + --script-security "${security:-2}" \ + $(openvpn_get_dev "$name" "$conf") procd_set_param file "$dir/$conf" procd_set_param term_timeout 15 procd_set_param respawn From c90528c26f4c673150ce1283ba464173acf92d0c Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Fri, 7 Aug 2020 18:58:07 +0800 Subject: [PATCH 17/19] luci-app-passwall: bump to 3.9-31 --- package/lienol/luci-app-passwall/Makefile | 4 +- .../luasrc/model/cbi/passwall/api/api.lua | 8 + .../luasrc/model/cbi/passwall/global.lua | 30 +- .../luasrc/model/cbi/passwall/node_config.lua | 44 +- .../model/cbi/passwall/server/api/app.lua | 4 +- .../luasrc/model/cbi/passwall/server/user.lua | 30 +- .../luasrc/view/passwall/global/status.htm | 11 +- .../luasrc/view/passwall/global/status2.htm | 15 +- .../root/usr/share/passwall/app.sh | 512 +++++++++--------- 9 files changed, 322 insertions(+), 336 deletions(-) diff --git a/package/lienol/luci-app-passwall/Makefile b/package/lienol/luci-app-passwall/Makefile index ca040073f8..7b70ac80f7 100644 --- a/package/lienol/luci-app-passwall/Makefile +++ b/package/lienol/luci-app-passwall/Makefile @@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=3.9 -PKG_RELEASE:=29 -PKG_DATE:=20200802 +PKG_RELEASE:=31 +PKG_DATE:=20200807 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua index 3ecc304853..6a44a4cf4b 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua @@ -43,6 +43,14 @@ function chmod_755(file) end end +function get_customed_path(e) + return uci_get_type("global_app", e .. "_file") +end + +function is_finded(e) + return luci.sys.exec('type -t -p "%s/%s" -p "/usr/bin/v2ray/%s" "%s"' % {get_customed_path(e), e, e, e}) ~= "" and true or false +end + function get_v2ray_path() local path = uci_get_type("global_app", "v2ray_file") return path .. "/v2ray" diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua index 22464db365..7fb2112806 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua @@ -1,18 +1,8 @@ local o = require "luci.dispatcher" -local sys = require "luci.sys" -local ipkg = require("luci.model.ipkg") local uci = require"luci.model.uci".cursor() -local _api = require "luci.model.cbi.passwall.api.api" +local api = require "luci.model.cbi.passwall.api.api" local appname = "passwall" -local function is_installed(e) return ipkg.installed(e) end - -local function is_finded(e) - return - sys.exec("find /usr/*bin -iname " .. e .. " -type f") ~= "" and true or - false -end - local nodes_table = {} uci:foreach(appname, "nodes", function(e) if e.type and e.remarks then @@ -127,20 +117,19 @@ o:value("210.2.4.8", "210.2.4.8 (CNNIC DNS)") o:value("180.76.76.76", "180.76.76.76 (" .. translate("Baidu") .. "DNS)") ---- DNS Forward Mode -o = s:taboption("DNS", ListValue, "dns_mode", translate("DNS Mode")) +o = s:taboption("DNS", Value, "dns_mode", translate("DNS Mode")) -- o.description = translate("if has problem, please try another mode.
if you use no patterns are used, DNS of wan will be used by default as upstream of dnsmasq.") o.rmempty = false o:reset_values() -if is_finded("chinadns-ng") then +if api.is_finded("chinadns-ng") then o:value("chinadns-ng", "ChinaDNS-NG") end -if is_installed("pdnsd") or is_installed("pdnsd-alt") or is_finded("pdnsd") then +if api.is_finded("pdnsd") then o:value("pdnsd", "pdnsd") end -if is_finded("dns2socks") then +if api.is_finded("dns2socks") then o:value("dns2socks", "dns2socks") end -o:value("local_7913", translate("Use local port 7913 as DNS")) o:value("nonuse", translate("No patterns are used")) ---- Upstream trust DNS Server for ChinaDNS-NG @@ -148,17 +137,17 @@ o = s:taboption("DNS", ListValue, "up_trust_chinadns_ng_dns", translate("Upstream trust DNS Server for ChinaDNS-NG") .. "(UDP)") -- o.description = translate("You can use other resolving DNS services as trusted DNS, Example: dns2socks, dns-forwarder... 127.0.0.1#5353
Only use two at most, english comma separation, If you do not fill in the # and the following port, you are using port 53.") o.default = "pdnsd" -if is_installed("pdnsd") or is_installed("pdnsd-alt") or is_finded("pdnsd") then +if api.is_finded("pdnsd") then o:value("pdnsd", "pdnsd + " .. translate("Use TCP Node Resolve DNS")) end -if is_finded("dns2socks") then +if api.is_finded("dns2socks") then o:value("dns2socks", "dns2socks") end o:value("udp", translate("Use UDP Node Resolve DNS")) o:depends("dns_mode", "chinadns-ng") ---- Use TCP Node Resolve DNS ---[[ if is_installed("pdnsd") or is_installed("pdnsd-alt") or is_finded("pdnsd") then +--[[ if api.is_finded("pdnsd") then o = s:taboption("DNS", Flag, "use_tcp_node_resolve_dns", translate("Use TCP Node Resolve DNS")) o.description = translate("If checked, DNS is resolved using the TCP node.") o.default = 1 @@ -247,7 +236,7 @@ s.anonymous = true s.addremove = true s.template = "cbi/tblsection" function s.create(e, t) - TypedSection.create(e, _api.gen_uuid()) + TypedSection.create(e, api.gen_uuid()) end o = s:option(DummyValue, "status", translate("Status")) @@ -266,6 +255,7 @@ end for k, v in pairs(nodes_table) do o:value(v.id, v.remarks) end o = s:option(Value, "port", translate("Listen Port")) +o.default = 9050 o.datatype = "port" o.rmempty = false diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_config.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_config.lua index 76ed33680c..00110afd25 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_config.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/node_config.lua @@ -1,20 +1,8 @@ local d = require "luci.dispatcher" -local ipkg = require("luci.model.ipkg") local uci = require"luci.model.uci".cursor() local api = require "luci.model.cbi.passwall.api.api" - local appname = "passwall" -local function get_customed_path(e) - return api.uci_get_type("global_app", e .. "_file") -end - -local function is_finded(e) - return luci.sys.exec("find /usr/*bin %s -iname %s -type f" % {get_customed_path(e), e}) ~= "" and true or false -end - -local function is_installed(e) return ipkg.installed(e) end - local ss_encrypt_method_list = { "rc4-md5", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "bf-cfb", "camellia-128-cfb", @@ -82,25 +70,25 @@ remarks.default = translate("Remarks") remarks.rmempty = false type = s:option(ListValue, "type", translate("Type")) -if is_installed("ipt2socks") or is_finded("ipt2socks") then +if api.is_finded("ipt2socks") then type:value("Socks", translate("Socks")) end -if is_finded("ss-redir") then +if api.is_finded("ss-redir") then type:value("SS", translate("Shadowsocks")) end -if is_finded("ssr-redir") then +if api.is_finded("ssr-redir") then type:value("SSR", translate("ShadowsocksR")) end -if is_installed("v2ray") or is_finded("v2ray") then +if api.is_finded("v2ray") then type:value("V2ray", translate("V2ray")) end -if is_installed("brook") or is_finded("brook") then +if api.is_finded("brook") then type:value("Brook", translate("Brook")) end -if is_installed("trojan-plus") or is_finded("trojan-plus") then - type:value("Trojan", translate("Trojan-Plus")) +if api.is_finded("trojan-plus") or api.is_finded("trojan") then + type:value("Trojan-Plus", translate("Trojan-Plus")) end -if is_installed("trojan-go") or is_finded("trojan-go") then +if api.is_finded("trojan-go") then type:value("Trojan-Go", translate("Trojan-Go")) end @@ -166,7 +154,7 @@ address:depends({ type = "V2ray", protocol = "http" }) address:depends({ type = "V2ray", protocol = "socks" }) address:depends({ type = "V2ray", protocol = "shadowsocks" }) address:depends("type", "Brook") -address:depends("type", "Trojan") +address:depends("type", "Trojan-Plus") address:depends("type", "Trojan-Go") --[[ @@ -180,7 +168,7 @@ use_ipv6:depends({ type = "V2ray", protocol = "http" }) use_ipv6:depends({ type = "V2ray", protocol = "socks" }) use_ipv6:depends({ type = "V2ray", protocol = "shadowsocks" }) use_ipv6:depends("type", "Brook") -use_ipv6:depends("type", "Trojan") +use_ipv6:depends("type", "Trojan-Plus") use_ipv6:depends("type", "Trojan-Go") --]] @@ -195,7 +183,7 @@ port:depends({ type = "V2ray", protocol = "http" }) port:depends({ type = "V2ray", protocol = "socks" }) port:depends({ type = "V2ray", protocol = "shadowsocks" }) port:depends("type", "Brook") -port:depends("type", "Trojan") +port:depends("type", "Trojan-Plus") port:depends("type", "Trojan-Go") username = s:option(Value, "username", translate("Username")) @@ -209,7 +197,7 @@ password:depends("type", "Socks") password:depends("type", "SS") password:depends("type", "SSR") password:depends("type", "Brook") -password:depends("type", "Trojan") +password:depends("type", "Trojan-Plus") password:depends("type", "Trojan-Go") password:depends("protocol", "http") password:depends("protocol", "socks") @@ -260,13 +248,13 @@ tcp_fast_open:value("false") tcp_fast_open:value("true") tcp_fast_open:depends("type", "SS") tcp_fast_open:depends("type", "SSR") -tcp_fast_open:depends("type", "Trojan") +tcp_fast_open:depends("type", "Trojan-Plus") tcp_fast_open:depends("type", "Trojan-Go") ss_plugin = s:option(ListValue, "ss_plugin", translate("plugin")) ss_plugin:value("none", translate("none")) -if is_finded("v2ray-plugin") then ss_plugin:value("v2ray-plugin") end -if is_finded("obfs-local") then ss_plugin:value("obfs-local") end +if api.is_finded("v2ray-plugin") then ss_plugin:value("v2ray-plugin") end +if api.is_finded("obfs-local") then ss_plugin:value("obfs-local") end ss_plugin:depends("type", "SS") ss_plugin_opts = s:option(Value, "ss_plugin_opts", translate("opts")) @@ -310,7 +298,7 @@ stream_security.default = "tls" stream_security:depends("protocol", "vmess") stream_security:depends("protocol", "socks") stream_security:depends("protocol", "shadowsocks") -stream_security:depends("type", "Trojan") +stream_security:depends("type", "Trojan-Plus") stream_security:depends("type", "Trojan-Go") stream_security.validate = function(self, value) if value == "none" and type:formvalue(arg[1]) == "Trojan" then diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/api/app.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/api/app.lua index 1c4948e388..dbb6b7622c 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/api/app.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/api/app.lua @@ -79,7 +79,7 @@ local function start() elseif type == "V2ray" then config = require("luci.model.cbi.passwall.server.api.v2ray").gen_config(user) bin = ln_start(_api.get_v2ray_path(), "v2ray", "-config=" .. config_file) - elseif type == "Trojan" then + elseif type == "Trojan-Plus" then config = require("luci.model.cbi.passwall.server.api.trojan").gen_config(user) bin = ln_start("/usr/sbin/trojan-plus", "trojan-plus", "-c " .. config_file) elseif type == "Trojan-Go" then @@ -130,4 +130,4 @@ if action then elseif action == "stop" then stop() end -end +end \ No newline at end of file diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua index eca29b7291..4b8613b241 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua @@ -1,17 +1,7 @@ local d = require "luci.dispatcher" -local ipkg = require("luci.model.ipkg") local uci = require"luci.model.uci".cursor() local api = require "luci.model.cbi.passwall.api.api" -local function is_finded(e) - local function get_customed_path(e) - return api.uci_get_type("global_app", e .. "_file") - end - return luci.sys.exec("find /usr/*bin %s -iname %s -type f" % {get_customed_path(e), e}) ~= "" and true or false -end - -local function is_installed(e) return ipkg.installed(e) end - local ssr_encrypt_method_list = { "none", "table", "rc2-cfb", "rc4", "rc4-md5", "rc4-md5-6", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", @@ -70,19 +60,19 @@ remarks.default = translate("Remarks") remarks.rmempty = false type = s:option(ListValue, "type", translate("Type")) -if is_finded("ssr-server") then +if api.is_finded("ssr-server") then type:value("SSR", translate("ShadowsocksR")) end -if is_installed("v2ray") or is_finded("v2ray") then +if api.is_finded("v2ray") then type:value("V2ray", translate("V2ray")) end -if is_installed("brook") or is_finded("brook") then +if api.is_finded("brook") then type:value("Brook", translate("Brook")) end -if is_installed("trojan-plus") or is_finded("trojan-plus") then - type:value("Trojan", translate("Trojan-Plus")) +if api.is_finded("trojan-plus") or api.is_finded("trojan") then + type:value("Trojan-Plus", translate("Trojan-Plus")) end -if is_installed("trojan-go") or is_finded("trojan-go") then +if api.is_finded("trojan-go") then type:value("Trojan-Go", translate("Trojan-Go")) end @@ -115,7 +105,7 @@ password = s:option(Value, "password", translate("Password")) password.password = true password:depends("type", "SSR") password:depends("type", "Brook") -password:depends("type", "Trojan") +password:depends("type", "Trojan-Plus") password:depends({ type = "V2ray", protocol = "http" }) password:depends({ type = "V2ray", protocol = "socks" }) password:depends({ type = "V2ray", protocol = "shadowsocks" }) @@ -170,7 +160,7 @@ tcp_fast_open = s:option(ListValue, "tcp_fast_open", translate("TCP Fast Open"), tcp_fast_open:value("false") tcp_fast_open:value("true") tcp_fast_open:depends("type", "SSR") -tcp_fast_open:depends("type", "Trojan") +tcp_fast_open:depends("type", "Trojan-Plus") tcp_fast_open:depends("type", "Trojan-Go") udp_forward = s:option(Flag, "udp_forward", translate("UDP Forward")) @@ -203,7 +193,7 @@ stream_security:depends({ type = "V2ray", protocol = "vmess", transport = "ws" } stream_security:depends({ type = "V2ray", protocol = "vmess", transport = "h2" }) stream_security:depends({ type = "V2ray", protocol = "socks" }) stream_security:depends({ type = "V2ray", protocol = "shadowsocks" }) -stream_security:depends("type", "Trojan") +stream_security:depends("type", "Trojan-Plus") stream_security:depends("type", "Trojan-Go") stream_security.validate = function(self, value) if value == "none" and type:formvalue(arg[1]) == "Trojan" then @@ -373,7 +363,7 @@ quic_guise:depends("transport", "quic") remote_enable = s:option(Flag, "remote_enable", translate("Enable Remote"), translate("You can forward to Nginx/Caddy/V2ray WebSocket and more.")) remote_enable.default = "1" remote_enable.rmempty = false -remote_enable:depends("type", "Trojan") +remote_enable:depends("type", "Trojan-Plus") remote_enable:depends("type", "Trojan-Go") remote_address = s:option(Value, "remote_address", translate("Remote Address")) diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm index c1e00c144b..8364ac0c18 100644 --- a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm +++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm @@ -1,15 +1,6 @@ <% -local api = require "luci.model.cbi.passwall.api.api" local dsp = require "luci.dispatcher" -local ipkg = require "luci.model.ipkg" - -local function is_finded(e) - local result=luci.sys.exec("find /usr/*bin -iname "..e.." -type f") - if result~="" then - return true - end - return false -end +local api = require "luci.model.cbi.passwall.api.api" local tcp_node_num = api.uci_get_type("global_other", "tcp_node_num", 1) local udp_node_num = api.uci_get_type("global_other", "udp_node_num", 1) diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm index 722531d294..2bb7e3715d 100644 --- a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm +++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm @@ -1,15 +1,6 @@ <% -local api = require "luci.model.cbi.passwall.api.api" local dsp = require "luci.dispatcher" -local ipkg = require "luci.model.ipkg" - -local function is_finded(e) - local result=luci.sys.exec("find /usr/*bin -iname "..e.." -type f") - if result~="" then - return true - end - return false -end +local api = require "luci.model.cbi.passwall.api.api" local tcp_node_num = api.uci_get_type("global_other", "tcp_node_num", 1) local udp_node_num = api.uci_get_type("global_other", "udp_node_num", 1) @@ -81,7 +72,7 @@ local status_show_ip111 = api.uci_get_type("global_other", "status_show_ip111", - <% if ipkg.installed("kcptun") or is_finded("kcptun*") then %> + <% if api.is_finded("kcptun-client") then %>
<% end %> - <% if ipkg.installed("haproxy") or is_finded("haproxy*") then %> + <% if api.is_finded("haproxy") then %>