Browse code

gcc: update to 6.3

Fix gcc-6.3 compilation error for:
- logrotate
- xml-security-c
- thin-provisioning-tools
- ipxe: version update

Change-Id: I6ab46e74bbff7b9cd9d493ca13106a6be01910c0
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/2135
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Vinay Kulkarni <kulkarniv@vmware.com>

Alexey Makhalov authored on 2017/03/10 09:33:08
Showing 8 changed files
... ...
@@ -2,15 +2,15 @@ diff -Naur gcc-5.3.0.orig/gcc/c/c-typeck.c gcc-5.3.0/gcc/c/c-typeck.c
2 2
 --- gcc-5.3.0.orig/gcc/c/c-typeck.c	2015-10-05 05:35:20.000000000 -0700
3 3
 +++ gcc-5.3.0/gcc/c/c-typeck.c	2017-02-22 01:11:51.672617711 -0800
4 4
 @@ -69,6 +69,8 @@
5
+ #include "c-family/c-ubsan.h"
5 6
  #include "cilk.h"
6
- #include "wide-int.h"
7 7
  #include "gomp-constants.h"
8 8
 +#include "plugin-api.h"
9 9
 +#include "plugin.h"
10
+ #include "spellcheck.h"
11
+ #include "gcc-rich-location.h"
10 12
  
11
- /* Possible cases of implicit bad conversions.  Used to select
12
-    diagnostic messages in convert_for_assignment.  */
13
-@@ -5029,6 +5031,12 @@
13
+@@ -5277,6 +5279,12 @@
14 14
  	return error_mark_node;
15 15
      }
16 16
  
... ...
@@ -22,7 +22,7 @@ diff -Naur gcc-5.3.0.orig/gcc/c/c-typeck.c gcc-5.3.0/gcc/c/c-typeck.c
22 22
 +
23 23
    if (type == TYPE_MAIN_VARIANT (TREE_TYPE (value)))
24 24
      {
25
-       if (TREE_CODE (type) == RECORD_TYPE
25
+       if (RECORD_OR_UNION_TYPE_P (type))
26 26
 diff -Naur gcc-5.3.0.orig/gcc/plugin.c gcc-5.3.0/gcc/plugin.c
27 27
 --- gcc-5.3.0.orig/gcc/plugin.c	2015-01-30 08:15:00.000000000 -0800
28 28
 +++ gcc-5.3.0/gcc/plugin.c	2017-02-22 01:04:55.642416671 -0800
... ...
@@ -1,15 +1,15 @@
1 1
 %define _use_internal_dependency_generator 0
2 2
 Summary:        Contains the GNU compiler collection
3 3
 Name:           gcc
4
-Version:        5.3.0
5
-Release:        6%{?dist}
4
+Version:        6.3.0
5
+Release:        1%{?dist}
6 6
 License:        GPLv2+
7 7
 URL:            http://gcc.gnu.org
8 8
 Group:          Development/Tools
9 9
 Vendor:         VMware, Inc.
10 10
 Distribution:   Photon
11 11
 Source0:        http://ftp.gnu.org/gnu/gcc/%{name}-%{version}/%{name}-%{version}.tar.bz2
12
-%define sha1 gcc=0612270b103941da08376df4d0ef4e5662a2e9eb
12
+%define sha1 gcc=928ab552666ee08eed645ff20ceb49d139205dea
13 13
 Patch0:         PLUGIN_TYPE_CAST.patch
14 14
 Requires:       libstdc++-devel = %{version}-%{release}
15 15
 Requires:       libgcc-devel = %{version}-%{release}
... ...
@@ -79,8 +79,12 @@ This package contains development headers and static library for libgomp
79 79
 %prep
80 80
 %setup -q
81 81
 %patch0 -p1
82
+
83
+# disable FORTIFY_SOURCE=2 from hardening
82 84
 sed -i '/*cpp:/s/^/# /' `dirname $(gcc --print-libgcc-file-name)`/../specs
83 85
 sed -i '/Ofast:-D_FORTIFY_SOURCE=2/s/^/# /' `dirname $(gcc --print-libgcc-file-name)`/../specs
86
+# disable no-pie for gcc binaries
87
+sed -i '/^NO_PIE_CFLAGS = /s/@NO_PIE_CFLAGS@//' gcc/Makefile.in
84 88
 
85 89
 install -vdm 755 ../gcc-build
86 90
 %build
... ...
@@ -129,7 +133,7 @@ make %{?_smp_mflags} check
129 129
 %{_lib}/cpp
130 130
 #   Executables
131 131
 %exclude %{_bindir}/*gfortran
132
-%exclude %{_libexecdir}/gcc/x86_64-unknown-linux-gnu/5.3.0/f951
132
+%exclude %{_libexecdir}/gcc/x86_64-pc-linux-gnu/%{version}/f951
133 133
 %{_bindir}/*
134 134
 #   Libraries
135 135
 %ifarch x86_64
... ...
@@ -160,7 +164,7 @@ make %{?_smp_mflags} check
160 160
 %defattr(-,root,root)
161 161
 %{_bindir}/*gfortran
162 162
 %{_mandir}/man1/gfortran.1.gz
163
-%{_libexecdir}/gcc/x86_64-unknown-linux-gnu/5.3.0/f951
163
+%{_libexecdir}/gcc/x86_64-pc-linux-gnu/%{version}/f951
164 164
 
165 165
 %files -n libgcc
166 166
 %defattr(-,root,root)
... ...
@@ -232,7 +236,9 @@ make %{?_smp_mflags} check
232 232
 %endif
233 233
 
234 234
 %changelog
235
-*   Fri Mar 02 2017 Xiaolin Li <xiaolinl@vmware.com> 5.3.0-6
235
+*   Thu Mar 9 2017 Alexey Makhalov <amakhalov@vmware.com> 6.3.0-1
236
+-   Update version to 6.3
237
+*   Thu Mar 02 2017 Xiaolin Li <xiaolinl@vmware.com> 5.3.0-6
236 238
 -   Enabled fortran.
237 239
 *   Wed Feb 22 2017 Alexey Makhalov <amakhalov@vmware.com> 5.3.0-5
238 240
 -   Added new plugin entry point: PLUGIN_TYPE_CAST (.patch)
... ...
@@ -1,20 +1,18 @@
1 1
 %global security_hardening none
2
-%global commit          ed0d7c4f6f8db7bda1e74567693a0c525b9cf159
3
-%global shortcommit	%(c=%{commit}; echo ${c:0:7})
2
+%global commit          553f4857346faa8c5f6ddf9eced4180924890bfc.tar.bz2
4 3
 
5 4
 Summary:        iPXE open source boot firmware
6 5
 Name:           ipxe
7
-Version:        ed0d7c4
8
-Release:        2%{?dist}
6
+Version:        553f485
7
+Release:        1%{?dist}
9 8
 License:        GPLv2
10 9
 URL:            http://ipxe.org
11 10
 Group:          System Environment/Daemons
12 11
 Vendor:         VMware, Inc.
13 12
 Distribution:   Photon
14
-#Download URL:  https://git.ipxe.org/ipxe.git/snapshot/ed0d7c4f6f8db7bda1e74567693a0c525b9cf159.tar.gz
15
-Source0:        %{name}-%{version}.tar.gz
16
-%define sha1 ipxe=16db273987f525176d9ca6d97c40eb2076a1b47f
17
-
13
+#Download URL:  https://git.ipxe.org/ipxe.git/snapshot/%{commit}.tar.bz2
14
+Source0:        %{name}-%{version}.tar.bz2
15
+%define sha1 ipxe=723e1e46b00a7de870065b74f053941f46748062
18 16
 BuildRequires:  binutils
19 17
 BuildRequires:  binutils-devel
20 18
 BuildRequires:  cdrkit
... ...
@@ -22,8 +20,6 @@ BuildRequires:  gcc
22 22
 BuildRequires:  libgcc
23 23
 BuildRequires:  libgcc-devel
24 24
 BuildRequires:  make
25
-BuildRequires:  linux
26
-BuildRequires:  linux-devel
27 25
 BuildRequires:  perl
28 26
 BuildRequires:  xz
29 27
 BuildRequires:  xz-devel
... ...
@@ -35,7 +31,7 @@ iPXE is the leading open source network boot firmware. It provides a full
35 35
 PXE implementation enhanced with additional features.
36 36
 
37 37
 %prep
38
-%setup -q -n %{name}-%{shortcommit}
38
+%setup -q -n %{name}-%{version}
39 39
 
40 40
 %build
41 41
 cd src
... ...
@@ -65,7 +61,10 @@ install -vDm 644 src/bin/*.{rom,mrom} %{buildroot}/usr/share/ipxe/
65 65
 /usr/share/ipxe/rtl8139.rom
66 66
 
67 67
 %changelog
68
-*	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> ed0d7c4-2
69
--	GA - Bump release of all rpms
70
-*       Thu Nov 12 2015 Vinay Kulkarni <kulkarniv@vmware.com> ed0d7c4-1
71
--       Initial build. First version
68
+*   Mon Mar 13 2017 Alexey Makhalov <amakhalov@vmware.com> 553f485-1
69
+-   Version update to build with gcc-6.3
70
+-   Removed linux/linux-devel build-time dependency
71
+*   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> ed0d7c4-2
72
+-   GA - Bump release of all rpms
73
+*   Thu Nov 12 2015 Vinay Kulkarni <kulkarniv@vmware.com> ed0d7c4-1
74
+-   Initial build. First version
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:	Logrotate
2 2
 Name:		logrotate
3 3
 Version:	3.9.1
4
-Release:	2%{?dist}
4
+Release:	3%{?dist}
5 5
 License:	GPL+
6 6
 URL:		https://fedorahosted.org/logrotate
7 7
 Source0:	https://fedorahosted.org/releases/l/o/logrotate/%{name}-%{version}.tar.gz
... ...
@@ -19,7 +19,9 @@ The logrotate utility is designed to simplify the administration of log files on
19 19
 ./autogen.sh
20 20
 ./configure \
21 21
 	--prefix=%{_prefix}
22
-make %{?_smp_mflags}
22
+# logrotate code has misleading identation and GCC 6.3 does not like it.
23
+make %{?_smp_mflags} CFLAGS="-Wno-error=misleading-indentation -g -O2"
24
+
23 25
 %install
24 26
 make DESTDIR=%{buildroot} install
25 27
 install -vd %{buildroot}%{_sysconfdir}/logrotate.d
... ...
@@ -40,6 +42,8 @@ touch %{buildroot}%{_localstatedir}/lib/logrotate/logrotate.status
40 40
 %{_mandir}/man8/logrotate.8.gz
41 41
 /var/lib/logrotate/logrotate.status
42 42
 %changelog
43
+*	Mon Mar 13 2017 Alexey Makhalov <amakhalov@vmware.com> 3.9.1-3
44
+-	Compilation for gcc 6.3
43 45
 *	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 3.9.1-2
44 46
 -	GA - Bump release of all rpms
45 47
 *	Wed Jun 24 2015 Divya Thaluru <dthaluru@vmware.com> 3.9.1-1
46 48
new file mode 100644
... ...
@@ -0,0 +1,116 @@
0
+diff -Naur thin-provisioning-tools-0.6.1.orig/base/progress_monitor.cc thin-provisioning-tools-0.6.1/base/progress_monitor.cc
1
+--- thin-provisioning-tools-0.6.1.orig/base/progress_monitor.cc	2016-02-10 06:28:49.000000000 -0800
2
+@@ -63,16 +63,16 @@
3
+ 
4
+ //----------------------------------------------------------------
5
+ 
6
+-std::auto_ptr<base::progress_monitor>
7
++std::unique_ptr<base::progress_monitor>
8
+ base::create_progress_bar(std::string const &title)
9
+ {
10
+-	return auto_ptr<progress_monitor>(new progress_bar(title));
11
++	return unique_ptr<progress_monitor>(new progress_bar(title));
12
+ }
13
+ 
14
+-std::auto_ptr<base::progress_monitor>
15
++std::unique_ptr<base::progress_monitor>
16
+ base::create_quiet_progress_monitor()
17
+ {
18
+-	return auto_ptr<progress_monitor>(new quiet_progress());
19
++	return unique_ptr<progress_monitor>(new quiet_progress());
20
+ }
21
+ 
22
+ //----------------------------------------------------------------
23
+diff -Naur thin-provisioning-tools-0.6.1.orig/base/progress_monitor.h thin-provisioning-tools-0.6.1/base/progress_monitor.h
24
+--- thin-provisioning-tools-0.6.1.orig/base/progress_monitor.h	2016-02-10 06:28:49.000000000 -0800
25
+@@ -15,8 +15,8 @@
26
+ 		virtual void update_percent(unsigned) = 0;
27
+ 	};
28
+ 
29
+-	std::auto_ptr<progress_monitor> create_progress_bar(std::string const &title);
30
+-	std::auto_ptr<progress_monitor> create_quiet_progress_monitor();
31
++	std::unique_ptr<progress_monitor> create_progress_bar(std::string const &title);
32
++	std::unique_ptr<progress_monitor> create_quiet_progress_monitor();
33
+ }
34
+ 
35
+ //----------------------------------------------------------------
36
+diff -Naur thin-provisioning-tools-0.6.1.orig/base/xml_utils.cc thin-provisioning-tools-0.6.1/base/xml_utils.cc
37
+--- thin-provisioning-tools-0.6.1.orig/base/xml_utils.cc	2016-02-10 06:28:49.000000000 -0800
38
+@@ -14,7 +14,7 @@
39
+ 	persistent_data::check_file_exists(backup_file);
40
+ 	ifstream in(backup_file.c_str(), ifstream::in);
41
+ 
42
+-	std::auto_ptr<base::progress_monitor> monitor = create_monitor(quiet);
43
++	std::unique_ptr<base::progress_monitor> monitor = create_monitor(quiet);
44
+ 
45
+ 	size_t total = 0;
46
+ 	size_t input_length = get_file_length(backup_file);
47
+@@ -53,7 +53,7 @@
48
+ 	return info.st_size;
49
+ }
50
+ 
51
+-auto_ptr<base::progress_monitor>
52
++unique_ptr<base::progress_monitor>
53
+ xml_parser::create_monitor(bool quiet)
54
+ {
55
+ 	if (!quiet && isatty(fileno(stdout)))
56
+diff -Naur thin-provisioning-tools-0.6.1.orig/base/xml_utils.h thin-provisioning-tools-0.6.1/base/xml_utils.h
57
+--- thin-provisioning-tools-0.6.1.orig/base/xml_utils.h	2016-02-10 06:28:49.000000000 -0800
58
+@@ -37,7 +37,7 @@
59
+ 
60
+ 	private:
61
+ 		size_t get_file_length(string const &file) const;
62
+-		auto_ptr<base::progress_monitor> create_monitor(bool quiet);
63
++		unique_ptr<base::progress_monitor> create_monitor(bool quiet);
64
+ 
65
+ 		XML_Parser parser_;
66
+         };
67
+diff -Naur thin-provisioning-tools-0.6.1.orig/caching/cache_restore.cc thin-provisioning-tools-0.6.1/caching/cache_restore.cc
68
+--- thin-provisioning-tools-0.6.1.orig/caching/cache_restore.cc	2016-02-10 06:28:49.000000000 -0800
69
+@@ -32,7 +32,7 @@
70
+ 		return info.st_size;
71
+ 	}
72
+ 
73
+-	auto_ptr<progress_monitor> create_monitor(bool quiet) {
74
++	unique_ptr<progress_monitor> create_monitor(bool quiet) {
75
+ 		if (!quiet && isatty(fileno(stdout)))
76
+ 			return create_progress_bar("Restoring");
77
+ 		else
78
+@@ -70,7 +70,7 @@
79
+ 			check_file_exists(*fs.input);
80
+ 			ifstream in(fs.input->c_str(), ifstream::in);
81
+ 
82
+-			auto_ptr<progress_monitor> monitor = create_monitor(fs.quiet);
83
++			unique_ptr<progress_monitor> monitor = create_monitor(fs.quiet);
84
+ 			parse_xml(in, restorer, get_file_length(*fs.input), *monitor);
85
+ 
86
+ 		} catch (std::exception &e) {
87
+diff -Naur thin-provisioning-tools-0.6.1.orig/thin-provisioning/restore_emitter.cc thin-provisioning-tools-0.6.1/thin-provisioning/restore_emitter.cc
88
+--- thin-provisioning-tools-0.6.1.orig/thin-provisioning/restore_emitter.cc	2016-02-10 06:28:49.000000000 -0800
89
+@@ -142,7 +142,7 @@
90
+ 		bool device_exists(thin_dev_t dev) const {
91
+ 			uint64_t key[1] = {dev};
92
+ 			device_tree::maybe_value v = md_->details_->lookup(key);
93
+-			return v;
94
++			return !!v;
95
+ 		}
96
+ 
97
+ 		metadata::ptr md_;
98
+diff -Naur thin-provisioning-tools-0.6.1.orig/thin-provisioning/thin_pool.cc thin-provisioning-tools-0.6.1/thin-provisioning/thin_pool.cc
99
+--- thin-provisioning-tools-0.6.1.orig/thin-provisioning/thin_pool.cc	2016-02-10 06:28:49.000000000 -0800
100
+@@ -232,7 +232,7 @@
101
+ thin_pool::device_exists(thin_dev_t dev) const
102
+ {
103
+ 	uint64_t key[1] = {dev};
104
+-	return md_->details_->lookup(key);
105
++	return !!md_->details_->lookup(key);
106
+ }
107
+ 
108
+ //----------------------------------------------------------------
... ...
@@ -1,12 +1,13 @@
1 1
 Summary: 	Thin provisioning tools
2 2
 Name:		thin-provisioning-tools
3 3
 Version:	0.6.1
4
-Release:	2%{?dist}
4
+Release:	3%{?dist}
5 5
 License:	GPLv3+
6 6
 Group:		System Environment/Base
7 7
 URL:		https://github.com/jthornber/thin-provisioning-tools
8 8
 Source0:	https://github.com/jthornber/thin-provisioning-tools/releases/thin-provisioning-tools-%{version}.tar.gz
9 9
 %define sha1 thin-provisioning-tools=387096be52b2f846b8b83f3d8da8e2cc6775465f
10
+Patch0:		thin-provisioning-tools-fix-for-gcc-6.3.patch
10 11
 BuildRequires:	expat , libaio-devel, boost-devel
11 12
 Requires:	expat, libaio
12 13
 Vendor:		VMware, Inc.
... ...
@@ -21,8 +22,8 @@ are included and era check, dump, restore and invalidate to manage
21 21
 snapshot eras
22 22
 
23 23
 %prep
24
-#%setup -q -n thin-provisioning-tools-thin-provisioning-tools-%{version}
25 24
 %setup -q
25
+%patch0 -p1
26 26
 
27 27
 %build
28 28
 autoconf
... ...
@@ -73,8 +74,10 @@ make DESTDIR=%{buildroot} MANDIR=%{_mandir} install
73 73
 %{_sbindir}/thin_trim
74 74
 
75 75
 %changelog
76
-*	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 0.6.1-2
77
--	GA - Bump release of all rpms
76
+* Mon Mar 13 2017 Alexey Makhalov <amakhalov@vmware.com> 0.6.1-3
77
+- Fix gcc-6.3 compilation errors
78
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 0.6.1-2
79
+- GA - Bump release of all rpms
78 80
 * Thu Feb 25 2016 Kumar Kaushik <kaushikk@vmware.com> 0.6.1-1
79 81
 - Updating version
80 82
 * Tue Mar 3 2015 Divya Thaluru <dthaluru@vmware.com> 0.4.1-1
81 83
new file mode 100644
... ...
@@ -0,0 +1,12 @@
0
+diff -Naur xml-security-c-1.7.3.orig/xsec/tools/checksig/InteropResolver.cpp xml-security-c-1.7.3/xsec/tools/checksig/InteropResolver.cpp
1
+--- xml-security-c-1.7.3.orig/xsec/tools/checksig/InteropResolver.cpp	2012-07-23 09:56:10.000000000 -0700
2
+@@ -645,7 +645,7 @@
3
+ 
4
+ 	}
5
+ 
6
+-	return false;
7
++	return NULL;
8
+ 
9
+ }
10
+ 
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:	C++ XML Signature and Encryption library.
2 2
 Name:		xml-security-c
3 3
 Version:	1.7.3
4
-Release:	2%{?dist}
4
+Release:	3%{?dist}
5 5
 License:	Apache Software License
6 6
 URL:		http://santuario.apache.org/index.html
7 7
 Group:		Applications/System
... ...
@@ -9,6 +9,7 @@ Vendor:		VMware, Inc.
9 9
 Distribution:	Photon
10 10
 Source0:	http://apache.mirrors.lucidnetworks.net/santuario/c-library/%{name}-%{version}.tar.gz
11 11
 %define sha1 xml-security-c=bcbe98e0bd3695a0b961a223cce53e2f35c4681b
12
+Patch0:		xml-security-c-fix-for-gcc-6.3.patch
12 13
 Requires:	openssl
13 14
 Requires:	xerces-c
14 15
 BuildRequires:	openssl-devel
... ...
@@ -23,6 +24,7 @@ Requires:       %{name} = %{version}-%{release}
23 23
 This package contains development headers and static library for xml security.
24 24
 %prep
25 25
 %setup -q
26
+%patch0 -p1
26 27
 %build
27 28
 ./configure --prefix=/usr
28 29
 make %{?_smp_mflags}
... ...
@@ -40,9 +42,11 @@ make DESTDIR=%{buildroot} install
40 40
 %{_libdir}/*.a
41 41
 %{_includedir}/*
42 42
 %changelog
43
-*	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.7.3-2
44
--	GA - Bump release of all rpms
45
-*   	Wed Jan 20 2016 Anish Swaminathan <anishs@vmware.com> 1.7.3-1
46
--   	Upgrade version.
47
-*	Thu Nov 06 2014 Sharath George <sharathg@vmware.com> 1.5.1-1
48
-	Initial version
43
+*   Mon Mar 13 2017 Alexey Makhalov <amakhalov@vmware.com> 1.7.3-3
44
+-   Patch for gcc-6.3
45
+*   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.7.3-2
46
+-   GA - Bump release of all rpms
47
+*   Wed Jan 20 2016 Anish Swaminathan <anishs@vmware.com> 1.7.3-1
48
+-   Upgrade version.
49
+*   Thu Nov 06 2014 Sharath George <sharathg@vmware.com> 1.5.1-1
50
+-   Initial version