Some minor tweaks to Carlos's patch...
1. Require C++ only when the with/without options call for it
2. When --without docs, make sure there are no docs left in the install tree to prevent generating RPMs.
Tested all 16 permutations of bootstrap/docs/testsuite/werror, 75% of the cases failed to produce RPMs without this tweak, 100% produce RPMs with this tweak.
--- glibc.spec.before 2015-10-26 23:52:05.809000000 -0400 +++ glibc.spec 2015-10-28 16:41:28.879000000 -0400 @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.22-193-g315267a %define glibcversion 2.22.90 -%define glibcrelease 6%{?dist} +%define glibcrelease 8%{?dist} # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -389,10 +389,14 @@ BuildRequires: rpm >= 4.2-0.56 %endif
+%if %{without boostrap} +%if %{with testsuite} # The testsuite builds static C++ binaries that require a C++ compiler # and static C++ runtime from libstdc++-static. BuildRequires: gcc-c++ BuildRequires: libstdc++-static +%endif +%endif
# Filter out all GLIBC_PRIVATE symbols since they are internal to # the package and should not be examined by any other tool. @@ -1017,6 +1021,10 @@
# Compress all of the info files. gzip -9nvf $RPM_BUILD_ROOT%{_infodir}/libc* + +%else +rm -f $RPM_BUILD_ROOT%{_infodir}/dir +rm -f $RPM_BUILD_ROOT%{_infodir}/libc.info* %endif
############################################################################## @@ -1214,9 +1222,7 @@ # the core glibc package. sed -i -e '|%{_libdir}/lib.*_p.a|d' \ -e '|%{_prefix}/include|d' \ -%if %{with docs} -e '|%{_infodir}|d' \ -%endif rpm.filelist
# Put some static files into the devel package. @@ -1851,6 +1857,10 @@ %endif
%changelog +* Wed Oct 28 2015 DJ Delorie <dj#redhat.com> - 2.22.90-8 +- Require gcc-c++ only when needed +- Fix --without docs to not leave info files + * Wed Sep 16 2015 Mike FABIAN mfabian@redhat.com - 2.22.90-7 - Add the C.UTF-8 locale (#902094).
* DJ Delorie:
+%if %{without boostrap} +%if %{with testsuite} # The testsuite builds static C++ binaries that require a C++ compiler # and static C++ runtime from libstdc++-static. BuildRequires: gcc-c++ BuildRequires: libstdc++-static +%endif +%endif
Patch looks good to me.
Maybe you can add
BuildRequires: glibc-static
to the above? From now on, upstream C++ tests only run if C++ applications can be linked statically.
Florian
On 10/29/2015 05:52 PM, DJ Delorie wrote:
Maybe you can add
BuildRequires: glibc-static
to the above? From now on, upstream C++ tests only run if C++ applications can be linked statically.
It won't use its own local files? I would think that using a pre-installed static glibc would invalidate the tests...
It always uses it's own local files.
The addition of "BuildRequires: glibc-static" is not required.
Adding it would create a circular build dep that needs breaking with bootstrap.
c.
On 10/30/2015 12:01 AM, Carlos O'Donell wrote:
On 10/29/2015 05:52 PM, DJ Delorie wrote:
Maybe you can add
BuildRequires: glibc-static
to the above? From now on, upstream C++ tests only run if C++ applications can be linked statically.
It won't use its own local files? I would think that using a pre-installed static glibc would invalidate the tests...
It always uses it's own local files.
There is now a check of static linking of C++ programs upstream. This is needed because we have one C++ test which is statically linked. Upstream now marks all C++ tests as UNSUPPORTED if the C++ toolchain does not support static linking. I had a patch which marked only one test, but Roland requested that the new configure test should be folded into the general C++ availability check.
I hope this clarifies matters.
The C++ static linking test is technically unsupported (officially you need to recompile static libstdc++ if you use a different glibc version). But we should probably move this discussion upstream if you are unsatisfied with the glibc-static build dependency (it does not add additional circularity because we have that already with libstdc++).
Florian
On 10/30/2015 05:15 AM, Florian Weimer wrote:
On 10/30/2015 12:01 AM, Carlos O'Donell wrote:
On 10/29/2015 05:52 PM, DJ Delorie wrote:
Maybe you can add
BuildRequires: glibc-static
to the above? From now on, upstream C++ tests only run if C++ applications can be linked statically.
It won't use its own local files? I would think that using a pre-installed static glibc would invalidate the tests...
It always uses it's own local files.
There is now a check of static linking of C++ programs upstream. This is needed because we have one C++ test which is statically linked. Upstream now marks all C++ tests as UNSUPPORTED if the C++ toolchain does not support static linking. I had a patch which marked only one test, but Roland requested that the new configure test should be folded into the general C++ availability check.
Aha! And that because configure runs before the library is built it detects no static linking support and marks everything UNSUPPORTED.
If you ever think there is something we should be documenting with respect to C/C++ application guidelines for Fedora we should update this wiki page: https://fedoraproject.org/wiki/C_and_C%2B%2B
It's unofficial, and C/C++ are the *only* languages without official packaging guidelines in Fedora. I started the page to document as much as we can e.g. removal of BuildRequires on glibc-headers which restricts the build-deps for no reason.
OK, I'll tell DJ to fold in your suggestion.
I hope this clarifies matters.
It does.
The C++ static linking test is technically unsupported (officially you need to recompile static libstdc++ if you use a different glibc version). But we should probably move this discussion upstream if you are unsatisfied with the glibc-static build dependency (it does not add additional circularity because we have that already with libstdc++).
We need no cycles in the bootstrap, and libstdc++ is going to get a --with bootstrap option so it too doesn't have a cycle. However, the original cycle is solved by the bootstrap script building things by hand. It's just that at the RPM phase we'd like to avoid a cycle until we build everything once.
Does that clarify it?
Cheers, Carlos.
On 10/28/2015 04:43 PM, DJ Delorie wrote:
Some minor tweaks to Carlos's patch...
Require C++ only when the with/without options call for it
When --without docs, make sure there are no docs left in the install tree to prevent generating RPMs.
Looks good to me.
Are you able to commit this to Rawhide?
Tested all 16 permutations of bootstrap/docs/testsuite/werror, 75% of the cases failed to produce RPMs without this tweak, 100% produce RPMs with this tweak.
--- glibc.spec.before 2015-10-26 23:52:05.809000000 -0400 +++ glibc.spec 2015-10-28 16:41:28.879000000 -0400 @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.22-193-g315267a %define glibcversion 2.22.90 -%define glibcrelease 6%{?dist} +%define glibcrelease 8%{?dist} # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -389,10 +389,14 @@ BuildRequires: rpm >= 4.2-0.56 %endif
+%if %{without boostrap} +%if %{with testsuite} # The testsuite builds static C++ binaries that require a C++ compiler # and static C++ runtime from libstdc++-static. BuildRequires: gcc-c++ BuildRequires: libstdc++-static +%endif +%endif
# Filter out all GLIBC_PRIVATE symbols since they are internal to # the package and should not be examined by any other tool. @@ -1017,6 +1021,10 @@
# Compress all of the info files. gzip -9nvf $RPM_BUILD_ROOT%{_infodir}/libc*
+%else +rm -f $RPM_BUILD_ROOT%{_infodir}/dir +rm -f $RPM_BUILD_ROOT%{_infodir}/libc.info* %endif
############################################################################## @@ -1214,9 +1222,7 @@ # the core glibc package. sed -i -e '|%{_libdir}/lib.*_p.a|d' \ -e '|%{_prefix}/include|d' \ -%if %{with docs} -e '|%{_infodir}|d' \ -%endif rpm.filelist
# Put some static files into the devel package. @@ -1851,6 +1857,10 @@ %endif
%changelog +* Wed Oct 28 2015 DJ Delorie <dj#redhat.com> - 2.22.90-8 +- Require gcc-c++ only when needed +- Fix --without docs to not leave info files
- Wed Sep 16 2015 Mike FABIAN mfabian@redhat.com - 2.22.90-7
- Add the C.UTF-8 locale (#902094).
glibc mailing list glibc@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/glibc
On 29 October 2015 12:43:40 am GMT+04:00, DJ Delorie dj@redhat.com wrote:
%changelog +* Wed Oct 28 2015 DJ Delorie <dj#redhat.com> - 2.22.90-8 +- Require gcc-c++ only when needed +- Fix --without docs to not leave info files
@redhat.com
Siddhesh
On 10/28/2015 04:43 PM, DJ Delorie wrote:
Some minor tweaks to Carlos's patch...
+%if %{without boostrap} +%if %{with testsuite} # The testsuite builds static C++ binaries that require a C++ compiler # and static C++ runtime from libstdc++-static. BuildRequires: gcc-c++ BuildRequires: libstdc++-static +%endif +%endif
Please add Florian's suggestion of BuildRequires: glibc-static, since he's right, we'll need it for configure static C++ linking detection to work correctly in a minimal sysroot.
So we need: # A configure check tests for static C++ binaries before glibc is built # therefore we need a glibc-static for that check to pass. BuildRequires: glibc-static.
Cheers, Carlos.
Please add Florian's suggestion of BuildRequires: glibc-static, since he's right, we'll need it for configure static C++ linking detection to work correctly in a minimal sysroot.
So we need: # A configure check tests for static C++ binaries before glibc is built # therefore we need a glibc-static for that check to pass. BuildRequires: glibc-static.
Latest patch...
--- glibc.spec.before 2015-10-26 23:52:05.809000000 -0400 +++ glibc.spec 2015-10-30 16:58:11.728000000 -0400 @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.22-193-g315267a %define glibcversion 2.22.90 -%define glibcrelease 6%{?dist} +%define glibcrelease 8%{?dist} # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -389,10 +389,15 @@ BuildRequires: rpm >= 4.2-0.56 %endif
+%if %{without boostrap} +%if %{with testsuite} # The testsuite builds static C++ binaries that require a C++ compiler # and static C++ runtime from libstdc++-static. BuildRequires: gcc-c++ BuildRequires: libstdc++-static +BuildRequires: glibc-static +%endif +%endif
# Filter out all GLIBC_PRIVATE symbols since they are internal to # the package and should not be examined by any other tool. @@ -1017,6 +1022,10 @@
# Compress all of the info files. gzip -9nvf $RPM_BUILD_ROOT%{_infodir}/libc* + +%else +rm -f $RPM_BUILD_ROOT%{_infodir}/dir +rm -f $RPM_BUILD_ROOT%{_infodir}/libc.info* %endif
############################################################################## @@ -1214,9 +1223,7 @@ # the core glibc package. sed -i -e '|%{_libdir}/lib.*_p.a|d' \ -e '|%{_prefix}/include|d' \ -%if %{with docs} -e '|%{_infodir}|d' \ -%endif rpm.filelist
# Put some static files into the devel package. @@ -1851,6 +1858,11 @@ %endif
%changelog +* Fri Oct 30 2015 DJ Delorie dj@redhat.com - 2.22.90-8 +- Require gcc-c++ only when needed +- Require glibc-static for C++ tests +- Fix --without docs to not leave info files + * Wed Sep 16 2015 Mike FABIAN mfabian@redhat.com - 2.22.90-7 - Add the C.UTF-8 locale (#902094).
On 10/30/2015 05:06 PM, DJ Delorie wrote:
Please add Florian's suggestion of BuildRequires: glibc-static, since he's right, we'll need it for configure static C++ linking detection to work correctly in a minimal sysroot.
So we need: # A configure check tests for static C++ binaries before glibc is built # therefore we need a glibc-static for that check to pass. BuildRequires: glibc-static.
Latest patch...
Applied to rawhide. I'll push this shortly after a few more tests.
--- glibc.spec.before 2015-10-26 23:52:05.809000000 -0400 +++ glibc.spec 2015-10-30 16:58:11.728000000 -0400 @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.22-193-g315267a %define glibcversion 2.22.90 -%define glibcrelease 6%{?dist} +%define glibcrelease 8%{?dist} # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -389,10 +389,15 @@ BuildRequires: rpm >= 4.2-0.56 %endif
+%if %{without boostrap} +%if %{with testsuite} # The testsuite builds static C++ binaries that require a C++ compiler # and static C++ runtime from libstdc++-static. BuildRequires: gcc-c++ BuildRequires: libstdc++-static +BuildRequires: glibc-static +%endif +%endif
# Filter out all GLIBC_PRIVATE symbols since they are internal to # the package and should not be examined by any other tool. @@ -1017,6 +1022,10 @@
# Compress all of the info files. gzip -9nvf $RPM_BUILD_ROOT%{_infodir}/libc*
+%else +rm -f $RPM_BUILD_ROOT%{_infodir}/dir +rm -f $RPM_BUILD_ROOT%{_infodir}/libc.info* %endif
############################################################################## @@ -1214,9 +1223,7 @@ # the core glibc package. sed -i -e '|%{_libdir}/lib.*_p.a|d' \ -e '|%{_prefix}/include|d' \ -%if %{with docs} -e '|%{_infodir}|d' \ -%endif rpm.filelist
# Put some static files into the devel package. @@ -1851,6 +1858,11 @@ %endif
%changelog +* Fri Oct 30 2015 DJ Delorie dj@redhat.com - 2.22.90-8 +- Require gcc-c++ only when needed +- Require glibc-static for C++ tests +- Fix --without docs to not leave info files
- Wed Sep 16 2015 Mike FABIAN mfabian@redhat.com - 2.22.90-7
- Add the C.UTF-8 locale (#902094).
glibc mailing list glibc@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/glibc