[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbsd-ports
Subject:    Re: lang/gcc/6: Install missing stdatomic.h header
From:       Brian Callahan <bcallah () devio ! us>
Date:       2018-11-29 17:19:41
Message-ID: 3f6f9e0c-f70f-c4a2-10ea-53a2ca17e0c0 () devio ! us
[Download RAW message or body]

On 11/29/18 8:17 AM, Pascal Stumpf wrote:
> On Wed, 28 Nov 2018 12:47:21 -0500, Brian Callahan wrote:
>>
>> On 11/28/18 6:54 AM, Stuart Henderson wrote:
>>> On 2018/11/27 19:36, George Koehler wrote:
>>>> On Tue, 27 Nov 2018 16:12:08 -0500
>>>> George Koehler <kernigh@gmail.com> wrote:
>>>>
>>>>> NetBSD's packages of gcc5 and gcc7 do contain the headers from float.h
>>>>> to stdatomic.h (or most of them).  I haven't found the reason why
>>>>> NetBSD keeps those headers and OpenBSD doesn't.
>>>> Found it!
>>>>
>>>> $ cat gcc-6.4.0/gcc/config/t-openbsd
>>>> # We don't need GCC's own include files.
>>>> USER_H = $(EXTRA_HEADERS)
>>>>
>>>> This t-openbsd gets enabled by gcc-6.4.0/gcc/config.gcc and then
>>>> included by build-powerpc/{prev-gcc,gcc}/Makefile so it overrides
>>>> USER_H.  The effect is to remove gcc's float.h, iso646.h, stdarg.h,
>>>> stdbool.h, stddef.h, varargs.h, stdfix.h, stdnoreturn.h, stdalign.h,
>>>> stdatomic.h from the compiler.
>>>>
>>>> The obvious fix (though I haven't tried it) is to remove this USER_H
>>>> override, either by commenting it or by patching config.gcc to ignore
>>>> t-openbsd.  Most platforms don't override USER_H.  (The only other
>>>> platform to override USER_H is config/mips/t-sdemtk, but its
>>>> override looks outdated to me.)
>>> This fix seems like the right approach in general to me, I think this
>>> is definitely worth trying.
>> This causes the build to fail rather quickly. Log attached.
>> I took the route of commenting out the USER_H line from t-openbsd.
>>
>>>> Another option is to keep the USER_H override and add only the 4
>>>> headers stdfix.h, stdnoreturn.h, stdalign.h, stdatomic.h.  This may
>>>> become outdated if a future version of gcc adds more headers.
>>> That sounds like it's asking for future trouble.
>> This allows the build to succeed, and seems to uncover some issues with
>> our port (like, we have been enabling SSP in configure but not actually
>> building or at least installing it?).
> We really don't want to install GCC's own libssp and ssp headers.  I
> have no idea why adding stuff to USER_H would suddenly enable these, but
> can you try to add --disable-libssp to CONFIGURE_ARGS?

Make sense. Yup, added that flag. Simpler diff overall that way. Attached.

~Brian

>> Diff attached to do add just those headers that are not in /usr/include
>> and the resulting PLIST changes. Yes it is more work keeping an eye out
>> to sync this list every time we update gcc, so it may be worth it to fix
>> the build with all headers enabled if we can.
>>
>> ~Brian
>>
>>>> Another option is to add the 4 headers to base OpenBSD.  If there
>>>> is some reason why /usr/include has its own float.h, iso646.h, and so
>>>> on, then the same reason might be why to add the 4 headers.
>>> I'm not sure if it's the same for all of these headers, but stdatomic.h
>>> in particular seems much more tightly bound to the compiler than to
>>> the OS.
>>>
>>>> gcc also has its own stdint.h, but doesn't use it on OpenBSD, because
>>>> config.gcc defaults to use_gcc_stdint=none and has no code to enable
>>>> it on OpenBSD.
>>>>
>>>> For comparison, ports-clang (pkg_info -L llvm) seems to package its
>>>> own float.h, iso646.h, and so on, and its own stdint.h; while
>>>> base-clang seems to omit headers that exist in /usr/include.
>>> It does for some but not others. diff -wu of iso646.h, for example,
>>> differs only in whitespace, copyright/PD notice, and double-inclusion
>>> protection macro..
>>>
>>
>>>> application/gzip attachment, name=gcc6.log.gz
>>>> text/x-patch content


["gcc-6-add-headers-2.diff" (text/x-patch)]

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/gcc/6/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- Makefile	26 Nov 2018 22:21:31 -0000	1.13
+++ Makefile	29 Nov 2018 17:18:18 -0000
@@ -6,7 +6,7 @@ ONLY_FOR_ARCHS = ${GCC49_ARCHS}
 DPB_PROPERTIES = parallel
 
 V = 6.4.0
-REVISION = 2
+REVISION = 3
 FULL_VERSION = $V
 FULL_PKGVERSION = $V
 
@@ -138,6 +138,7 @@ CONFIGURE_ARGS += \
 	--with-system-zlib \
 	--disable-libmudflap \
 	--disable-libgomp \
+	--disable-libssp \
 	--disable-tls \
 	--with-gnu-ld \
 	--with-gnu-as \
Index: patches/patch-gcc_config_t-openbsd
===================================================================
RCS file: patches/patch-gcc_config_t-openbsd
diff -N patches/patch-gcc_config_t-openbsd
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-gcc_config_t-openbsd	29 Nov 2018 17:18:18 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Make sure to include standard headers that are tightly bound
+to the compiler, such as stdatomic.h
+
+Index: gcc/config/t-openbsd
+--- gcc/config/t-openbsd.orig
++++ gcc/config/t-openbsd
+@@ -1,2 +1,6 @@
+ # We don't need GCC's own include files.
+-USER_H = $(EXTRA_HEADERS)
++USER_H = $(srcdir)/ginclude/stdfix.h \
++	 $(srcdir)/ginclude/stdnoreturn.h \
++	 $(srcdir)/ginclude/stdalign.h \
++	 $(srcdir)/ginclude/stdatomic.h \
++	 $(EXTRA_HEADERS)
Index: pkg/PLIST-c++
===================================================================
RCS file: /cvs/ports/lang/gcc/6/pkg/PLIST-c++,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST-c++
--- pkg/PLIST-c++	4 Sep 2016 16:20:22 -0000	1.1.1.1
+++ pkg/PLIST-c++	29 Nov 2018 17:18:18 -0000
@@ -219,6 +219,7 @@ include/c++/${V}/experimental/bits/fs_di
 include/c++/${V}/experimental/bits/fs_fwd.h
 include/c++/${V}/experimental/bits/fs_ops.h
 include/c++/${V}/experimental/bits/fs_path.h
+include/c++/${V}/experimental/bits/lfts_config.h
 include/c++/${V}/experimental/bits/shared_ptr.h
 include/c++/${V}/experimental/bits/string_view.tcc
 include/c++/${V}/experimental/chrono
Index: pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/lang/gcc/6/pkg/PLIST-main,v
retrieving revision 1.7
diff -u -p -r1.7 PLIST-main
--- pkg/PLIST-main	1 Nov 2018 22:09:30 -0000	1.7
+++ pkg/PLIST-main	29 Nov 2018 17:18:18 -0000
@@ -6,6 +6,7 @@
 @bin bin/egcc-nm
 @bin bin/egcc-ranlib
 @bin bin/egcov
+@bin bin/egcov-dump
 @bin bin/egcov-tool
 @bin bin/${CONFIG}-egcc
 @bin bin/${CONFIG}-egcc-ar
@@ -20,10 +21,15 @@
 lib/gcc/
 lib/gcc/${CONFIG}/
 lib/gcc/${CONFIG}/${V}/
+lib/gcc/${CONFIG}/${V}/include/
 lib/gcc/${CONFIG}/${V}/include-fixed/
 lib/gcc/${CONFIG}/${V}/include-fixed/README
 lib/gcc/${CONFIG}/${V}/include-fixed/limits.h
 lib/gcc/${CONFIG}/${V}/include-fixed/syslimits.h
+lib/gcc/${CONFIG}/${V}/include/stdalign.h
+lib/gcc/${CONFIG}/${V}/include/stdatomic.h
+lib/gcc/${CONFIG}/${V}/include/stdfix.h
+lib/gcc/${CONFIG}/${V}/include/stdnoreturn.h
 lib/gcc/${CONFIG}/${V}/install-tools/
 lib/gcc/${CONFIG}/${V}/install-tools/fixinc_list
 lib/gcc/${CONFIG}/${V}/install-tools/gsyslimits.h
@@ -437,6 +443,8 @@ libexec/gcc/${CONFIG}/${V}/plugin/
 @bin libexec/gcc/${CONFIG}/${V}/plugin/gengtype
 @man man/man1/ecpp.1
 @man man/man1/egcc.1
+@man man/man1/egcov-dump.1
+@man man/man1/egcov-tool.1
 @man man/man1/egcov.1
 @man man/man7/fsf-funding.7
 @man man/man7/gfdl.7


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic