From 748de698fb010ff0d34bf59aca4b035eaac6196e Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 6 Sep 2018 13:25:53 +0200 Subject: [PATCH] Update to version 4.9.0rc5 --- .gitignore | 2 + samba-4.9.0rc5-parallel-builds.patch | 54 +++++++++++++ samba-4.9.0rc5-stack-protector.patch | 117 +++++++++++++++++++++++++++ samba.spec | 8 +- sources | 4 +- 5 files changed, 182 insertions(+), 3 deletions(-) create mode 100644 samba-4.9.0rc5-parallel-builds.patch create mode 100644 samba-4.9.0rc5-stack-protector.patch diff --git a/.gitignore b/.gitignore index 16e6d40..5bea2a9 100644 --- a/.gitignore +++ b/.gitignore @@ -135,3 +135,5 @@ samba-3.6.0pre1.tar.gz /samba-4.9.0rc3.tar.asc /samba-4.9.0rc4.tar.xz /samba-4.9.0rc4.tar.asc +/samba-4.9.0rc5.tar.asc +/samba-4.9.0rc5.tar.xz diff --git a/samba-4.9.0rc5-parallel-builds.patch b/samba-4.9.0rc5-parallel-builds.patch new file mode 100644 index 0000000..9f8c014 --- /dev/null +++ b/samba-4.9.0rc5-parallel-builds.patch @@ -0,0 +1,54 @@ +From 45ff96780bad2c1f806b101ca1211f5c3cef1a4d Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Thu, 6 Sep 2018 12:40:10 +0200 +Subject: [PATCH] wafsamba: Deal with make -j + +Currently only make -j works for parallel builds and make -j4 results in +no parallel jobs at all. + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13606 + +Signed-off-by: Andreas Schneider +--- + buildtools/wafsamba/samba_utils.py | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py +index 0f95c125854..ad46005519f 100644 +--- a/buildtools/wafsamba/samba_utils.py ++++ b/buildtools/wafsamba/samba_utils.py +@@ -466,7 +466,7 @@ def CHECK_MAKEFLAGS(bld): + makeflags = os.environ.get('MAKEFLAGS') + if makeflags is None: + return +- jobs_set = False ++ jobs = 1 + # we need to use shlex.split to cope with the escaping of spaces + # in makeflags + for opt in shlex.split(makeflags): +@@ -489,17 +489,15 @@ def CHECK_MAKEFLAGS(bld): + setattr(Options.options, opt[0:loc], opt[loc+1:]) + elif opt[0] != '-': + for v in opt: +- if v == 'j': +- jobs_set = True ++ if re.search(r'j[0-9]*$', v): ++ jobs = int(opt.strip('j')) + elif v == 'k': + Options.options.keep = True +- elif opt == '-j': +- jobs_set = True ++ elif re.search(r'-j[0-9]*$', opt): ++ jobs = int(opt.strip('-j')) + elif opt == '-k': + Options.options.keep = True +- if not jobs_set: +- # default to one job +- Options.options.jobs = 1 ++ Options.options.jobs = jobs + + Build.BuildContext.CHECK_MAKEFLAGS = CHECK_MAKEFLAGS + +-- +2.18.0 + diff --git a/samba-4.9.0rc5-stack-protector.patch b/samba-4.9.0rc5-stack-protector.patch new file mode 100644 index 0000000..51bc83a --- /dev/null +++ b/samba-4.9.0rc5-stack-protector.patch @@ -0,0 +1,117 @@ +From e2dd47233f467e2ab80564968be4af6da6505161 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 3 Sep 2018 10:35:08 +0200 +Subject: [PATCH 1/2] waf: Check for -fstack-protect-strong support + +The -fstack-protector* flags are compiler only flags, don't pass them to +the linker. + +https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/ + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13601 + +Signed-off-by: Andreas Schneider +Reviewed-by: Andrew Bartlett +(cherry picked from commit 38e97f8b52e85bdfcf2d74a4fb3c848fa46ba371) +--- + buildtools/wafsamba/samba_autoconf.py | 36 ++++++++++++++------------- + 1 file changed, 19 insertions(+), 17 deletions(-) + +diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py +index c4391d0c4dc..bfd6f9710db 100644 +--- a/buildtools/wafsamba/samba_autoconf.py ++++ b/buildtools/wafsamba/samba_autoconf.py +@@ -674,23 +674,25 @@ def SAMBA_CONFIG_H(conf, path=None): + return + + # we need to build real code that can't be optimized away to test +- if conf.check(fragment=''' +- #include +- +- int main(void) +- { +- char t[100000]; +- while (fgets(t, sizeof(t), stdin)); +- return 0; +- } +- ''', +- execute=0, +- ccflags='-fstack-protector', +- ldflags='-fstack-protector', +- mandatory=False, +- msg='Checking if toolchain accepts -fstack-protector'): +- conf.ADD_CFLAGS('-fstack-protector') +- conf.ADD_LDFLAGS('-fstack-protector') ++ stack_protect_list = ['-fstack-protector-strong', '-fstack-protector'] ++ for stack_protect_flag in stack_protect_list: ++ flag_supported = conf.check(fragment=''' ++ #include ++ ++ int main(void) ++ { ++ char t[100000]; ++ while (fgets(t, sizeof(t), stdin)); ++ return 0; ++ } ++ ''', ++ execute=0, ++ ccflags=[ '-Werror', '-Wp,-D_FORTIFY_SOURCE=2', stack_protect_flag], ++ mandatory=False, ++ msg='Checking if compiler accepts %s' % (stack_protect_flag)) ++ if flag_supported: ++ conf.ADD_CFLAGS('-Wp,-D_FORTIFY_SOURCE=2 %s' % (stack_protect_flag)) ++ break + + if Options.options.debug: + conf.ADD_CFLAGS('-g', testflags=True) +-- +2.18.0 + + +From 09f3acb3497efb9ebb8a0d7d199726a8c318e4f8 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Mon, 3 Sep 2018 10:49:52 +0200 +Subject: [PATCH 2/2] waf: Add -fstack-clash-protection + +https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/ + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13601 + +Signed-off-by: Andreas Schneider +Reviewed-by: Andrew Bartlett +(cherry picked from commit fc4df251c88365142515a81bea1120b2b84cc4a0) +--- + buildtools/wafsamba/samba_autoconf.py | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py +index bfd6f9710db..f2b3ec8db8d 100644 +--- a/buildtools/wafsamba/samba_autoconf.py ++++ b/buildtools/wafsamba/samba_autoconf.py +@@ -694,6 +694,23 @@ def SAMBA_CONFIG_H(conf, path=None): + conf.ADD_CFLAGS('-Wp,-D_FORTIFY_SOURCE=2 %s' % (stack_protect_flag)) + break + ++ flag_supported = conf.check(fragment=''' ++ #include ++ ++ int main(void) ++ { ++ char t[100000]; ++ while (fgets(t, sizeof(t), stdin)); ++ return 0; ++ } ++ ''', ++ execute=0, ++ ccflags=[ '-Werror', '-fstack-clash-protection'], ++ mandatory=False, ++ msg='Checking if compiler accepts -fstack-clash-protection') ++ if flag_supported: ++ conf.ADD_CFLAGS('-fstack-clash-protection') ++ + if Options.options.debug: + conf.ADD_CFLAGS('-g', testflags=True) + +-- +2.18.0 + diff --git a/samba.spec b/samba.spec index a9cb3c5..2b28e4c 100644 --- a/samba.spec +++ b/samba.spec @@ -14,7 +14,7 @@ %define tevent_version 0.9.37 %define ldb_version 1.4.2 # This should be rc1 or nil -%define pre_release rc4 +%define pre_release rc5 %if "x%{?pre_release}" != "x" %define samba_release 0.%{main_release}.%{pre_release}%{?dist} @@ -121,6 +121,9 @@ Source14: samba.pamd Source201: README.downgrade +Patch0: samba-4.9.0rc5-stack-protector.patch +Patch1: samba-4.9.0rc5-parallel-builds.patch + Requires(pre): /usr/sbin/groupadd Requires(post): systemd Requires(preun): systemd @@ -3813,6 +3816,9 @@ fi %endif # with_clustering_support %changelog +* Thu Sep 06 2018 Andreas Schneider - 4.9.0rc5-3 +- Update to Samba 4.9.0rc5 + * Wed Aug 29 2018 Guenther Deschner - 4.9.0rc4-3 - Update to Samba 4.9.0rc4 diff --git a/sources b/sources index c841e61..cc1cb0f 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (samba-4.9.0rc4.tar.xz) = a3d2efa41c99ce378e570d909b5cfe8507f0cf14ad8303da6d115272de0239633e249a91fee754e8b6fa0ce13ea7354f2dbe26abe97d3eda091333681c3cc2ce -SHA512 (samba-4.9.0rc4.tar.asc) = 3cb8448c25e84d4895fd17057ea9c089d98edeb9eb3168e35cd3b6cf3df101408afa8897376b8b21b97e4a5e9ac74ecb1b7d5f582f935e0341109fc54c5fcd04 +SHA512 (samba-4.9.0rc5.tar.asc) = c70796cd5ffdea99ce474c07695af652b21df41de0dfe9548eb178e37792eecef0acaa4610361a88dee2e8e67fd5ab1dfefb5c214ee7f31b6dc34f68400868ab +SHA512 (samba-4.9.0rc5.tar.xz) = e6c1d49868044a3d7a33d5baf99a09869a6a3bfec6a81ee0042f381f7065215d0204f190b2a6cb679b4544e1ed31c34a0d7c0237f7ddcf72a94933cbae138d91