pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/54402: graphics/gdk-pixbuf2: Unrestricted definition of _XOPEN_SOURCE breaks build on FreeBSD 12



>Number:         54402
>Category:       pkg
>Synopsis:       graphics/gdk-pixbuf2: Unrestricted definition of _XOPEN_SOURCE breaks build on FreeBSD 12
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 23 18:15:01 +0000 2019
>Originator:     David Shao
>Release:        current pkgsrc
>Organization:
>Environment:
FreeBSD xxxxxx.xxx 12.0-RELEASE-p7 FreeBSD 12.0-RELEASE-p7 ee05953cd38(releng120) GENERIC  amd64
>Description:
A recent commit for graphics/gdk-pixbuf2 patches meson.build to define
-D_XOPEN_SOURCE=500

This kind of definition with a specific number such as 500 for _XOPEN_SOURCE is almost never a good thing on FreeBSD, probably other BSDs.  For this case, such a definition causes a simple function such as double round(double) from math.h to no longer be declared.

I believe what happens on FreeBSD is when _XOPEN_SOURCE is defined without a number, sys/cdefs.h will be able to set __BSD_VISIBLE enabling everything to be visible.  But once one defines _XOPEN_SOURCE to be some number in the hundreds, __BSD_VISIBLE does not get defined, throwing out visibility of anything not strictly in the standards.


>How-To-Repeat:

>Fix:
Would it be possible to restrict the change to SunOS such as:

@@ -8,7 +8,11 @@ project('gdk-pixbuf', 'c',
         ],
         meson_version: '>= 0.46.0')
 
-add_project_arguments([ '-D_POSIX_C_SOURCE=200809L', '-D_DEFAULT_SOURCE', '-D_XOPEN_SOURCE' ], language: 'c')
+if host_machine.system() == 'sunos'
+  add_project_arguments([ '-D_POSIX_C_SOURCE=200809L', '-D_DEFAULT_SOURCE', '-D_XOPEN_SOURCE=500' ], language: 'c')
+else
+  add_project_arguments([ '-D_POSIX_C_SOURCE=200809L', '-D_DEFAULT_SOURCE', '-D_XOPEN_SOURCE' ], language: 'c')
+endif
 
 cc = meson.get_compiler('c')
 host_system = host_machine.system()



Home | Main Index | Thread Index | Old Index