zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH v2] define _GNU_SOURCE
@ 2011-04-12 13:09 Valentin Ochs
  2011-04-13 16:10 ` build on os x 10.6.7, xcode 3.2.6 S. Cowles
  2011-04-14  8:35 ` [PATCH v2] define _GNU_SOURCE Peter Stephenson
  0 siblings, 2 replies; 7+ messages in thread
From: Valentin Ochs @ 2011-04-12 13:09 UTC (permalink / raw)
  To: zsh-workers

Sorry, haven't had my caffeine injection yet :)

The test for struct timezone needs _GNU_SOURCE as well, and it's
probably better to just use _POSIX_C_SOURCE for sigset_t.

Best regards,
Valentin

---
diff -upr -x configure -x config.h.in zsh-4.3.11/Src/system.h zsh/Src/system.h
--- zsh-4.3.11/Src/system.h     2010-02-22 11:12:31.000000000 +0100
+++ zsh/Src/system.h    2011-04-12 14:20:37.106000061 +0200
@@ -37,13 +37,12 @@
 #endif
 #endif

-#if defined(__linux) || defined(__GNU__) || defined(__GLIBC__)
 /*
  * Turn on numerous extensions.
  * This is in order to get the functions for manipulating /dev/ptmx.
  */
 #define _GNU_SOURCE 1
-#endif
+#define _POSIX_C_SOURCE 200809L

 /* NeXT has half-implemented POSIX support *
  * which currently fools configure         */
diff -upr -x configure -x config.h.in zsh-4.3.11/configure.ac zsh/configure.ac
--- zsh-4.3.11/configure.ac     2010-09-23 11:42:05.000000000 +0200
+++ zsh/configure.ac    2011-04-12 14:20:13.407000063 +0200
@@ -983,7 +983,8 @@ dnl <sys/types.h> and <signal.h>.  Other
 dnl to be added.
 AC_CACHE_CHECK(for sigset_t, zsh_cv_type_sigset_t,
 [AC_TRY_COMPILE(
-[#include <sys/types.h>
+[#define _POSIX_C_SOURCE 200809L
+#include <sys/types.h>
 #include <signal.h>], [sigset_t tempsigset;],
   zsh_cv_type_sigset_t=yes, zsh_cv_type_sigset_t=no)])
 AH_TEMPLATE([sigset_t],
@@ -1005,6 +1006,7 @@ AC_CHECK_MEMBERS([struct stat.st_atim.tv

 dnl Check for struct timezone since some old SCO versions do not define it
 zsh_TYPE_EXISTS([
+#define _GNU_SOURCE 1
 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
 #endif
--Valentin


^ permalink raw reply	[flat|nested] 7+ messages in thread

* build on os x 10.6.7, xcode 3.2.6
  2011-04-12 13:09 [PATCH v2] define _GNU_SOURCE Valentin Ochs
@ 2011-04-13 16:10 ` S. Cowles
  2011-04-13 16:26   ` Peter Stephenson
  2011-04-14  8:35 ` [PATCH v2] define _GNU_SOURCE Peter Stephenson
  1 sibling, 1 reply; 7+ messages in thread
From: S. Cowles @ 2011-04-13 16:10 UTC (permalink / raw)
  To: zsh-workers


i have been building source from the sourceforge cvs repository on os x 
10.6.x for the past two months with no issues, until this week.  as of 
rev4.3.11-dev-1, patchlevel 1.5245, i have begun getting the following 
build error

gcc -c -I. -I/opt/local/include -DHAVE_CONFIG_H -Wall -Wmissing-prototypes -O2  -o builtin.o builtin.c
In file included from zsh.mdh:37,
                  from builtin.c:33:
exec.epro:29: error: 'RLIM_NLIMITS' undeclared here (not in a function)
make[2]: *** [builtin.o] Error 1
make[1]: *** [modobjs] Error 2
make: *** [all] Error 1

previously, rev4.3.11-dev-1, patchlevel 1.5241, and prior, built with no 
problems.  i am still looking for what might cause the RLIM_NLIMITS 
definition to be missed, but wanted to find out if someone was already 
aware of this issue and might point out any possible mistake on my part.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: build on os x 10.6.7, xcode 3.2.6
  2011-04-13 16:10 ` build on os x 10.6.7, xcode 3.2.6 S. Cowles
@ 2011-04-13 16:26   ` Peter Stephenson
  2011-04-13 19:32     ` S. Cowles
  2011-04-13 19:56     ` Bart Schaefer
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Stephenson @ 2011-04-13 16:26 UTC (permalink / raw)
  To: zsh-workers

On Wed, 13 Apr 2011 09:10:47 -0700
"S. Cowles" <scowles@ckhb.org> wrote:
> i have been building source from the sourceforge cvs repository on os
> x 10.6.x for the past two months with no issues, until this week.  as
> of rev4.3.11-dev-1, patchlevel 1.5245, i have begun getting the
> following build error
> 
> gcc -c -I. -I/opt/local/include -DHAVE_CONFIG_H -Wall
> -Wmissing-prototypes -O2  -o builtin.o builtin.c In file included
> from zsh.mdh:37, from builtin.c:33:
> exec.epro:29: error: 'RLIM_NLIMITS' undeclared here (not in a
> function) make[2]: *** [builtin.o] Error 1
> make[1]: *** [modobjs] Error 2
> make: *** [all] Error 1
> 
> previously, rev4.3.11-dev-1, patchlevel 1.5241, and prior, built with
> no problems.  i am still looking for what might cause the
> RLIM_NLIMITS definition to be missed, but wanted to find out if
> someone was already aware of this issue and might point out any
> possible mistake on my part.

No, but there's a good chance it's got something to do with this
change.  Changing random source code options often has side effects.
Does removing either _GNU_SOURCE or _POSIX_C_SOURCE help?

--- zsh-4.3.11/Src/system.h     2010-02-22 11:12:31.000000000 +0100
+++ zsh/Src/system.h    2011-04-12 14:20:37.106000061 +0200
@@ -37,13 +37,12 @@
 #endif
 #endif

-#if defined(__linux) || defined(__GNU__) || defined(__GLIBC__)
 /*
  * Turn on numerous extensions.
  * This is in order to get the functions for manipulating /dev/ptmx.
  */
 #define _GNU_SOURCE 1
-#endif
+#define _POSIX_C_SOURCE 200809L

 /* NeXT has half-implemented POSIX support *
  * which currently fools configure         */

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: build on os x 10.6.7, xcode 3.2.6
  2011-04-13 16:26   ` Peter Stephenson
@ 2011-04-13 19:32     ` S. Cowles
  2011-04-13 19:56     ` Bart Schaefer
  1 sibling, 0 replies; 7+ messages in thread
From: S. Cowles @ 2011-04-13 19:32 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

On Wed, 13 Apr 2011, Peter Stephenson wrote:

> On Wed, 13 Apr 2011 09:10:47 -0700
> "S. Cowles" <scowles@ckhb.org> wrote:
>> i have been building source from the sourceforge cvs repository on os
>> x 10.6.x for the past two months with no issues, until this week.  as
>> of rev4.3.11-dev-1, patchlevel 1.5245, i have begun getting the
>> following build error
>>
>> gcc -c -I. -I/opt/local/include -DHAVE_CONFIG_H -Wall
>> -Wmissing-prototypes -O2  -o builtin.o builtin.c In file included
>> from zsh.mdh:37, from builtin.c:33:
>> exec.epro:29: error: 'RLIM_NLIMITS' undeclared here (not in a
>> function) make[2]: *** [builtin.o] Error 1
>> make[1]: *** [modobjs] Error 2
>> make: *** [all] Error 1
>>
>> previously, rev4.3.11-dev-1, patchlevel 1.5241, and prior, built with
>> no problems.  i am still looking for what might cause the
>> RLIM_NLIMITS definition to be missed, but wanted to find out if
>> someone was already aware of this issue and might point out any
>> possible mistake on my part.
>
> No, but there's a good chance it's got something to do with this
> change.  Changing random source code options often has side effects.
> Does removing either _GNU_SOURCE or _POSIX_C_SOURCE help?
>
> --- zsh-4.3.11/Src/system.h     2010-02-22 11:12:31.000000000 +0100
> +++ zsh/Src/system.h    2011-04-12 14:20:37.106000061 +0200
> @@ -37,13 +37,12 @@
> #endif
> #endif
>
> -#if defined(__linux) || defined(__GNU__) || defined(__GLIBC__)
> /*
>  * Turn on numerous extensions.
>  * This is in order to get the functions for manipulating /dev/ptmx.
>  */
> #define _GNU_SOURCE 1
> -#endif
> +#define _POSIX_C_SOURCE 200809L
>
> /* NeXT has half-implemented POSIX support *
>  * which currently fools configure         */


i checked all three cases:
 	1)
 		/* #define _GNU_SOURCE 1 /**/
 		#define _POSIX_C_SOURCE 200809L
 	2)
 		/* #define _GNU_SOURCE 1 /**/
 		/* #define _POSIX_C_SOURCE 200809L /**/
 	3)
 		#define _GNU_SOURCE 1
 		/* #define _POSIX_C_SOURCE 200809L /**/

cases 2 and 3 built patchlevel 1.5246 with no problem.  so, indeed,
removing _POSIX_C_SOURCE does help.  thank you very much for pinpointing
the search.

perhaps some directive such as the following might be sufficiently
restrictive to handle OS X and not interfere with other OS
installations on apple hardware:

#if !defined(__APPLE__) && !defined(__APPLE_CC__)
#define _POSIX_C_SOURCE 200809L
#endif


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: build on os x 10.6.7, xcode 3.2.6
  2011-04-13 16:26   ` Peter Stephenson
  2011-04-13 19:32     ` S. Cowles
@ 2011-04-13 19:56     ` Bart Schaefer
  1 sibling, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2011-04-13 19:56 UTC (permalink / raw)
  To: zsh-workers

On Apr 13,  5:26pm, Peter Stephenson wrote:
}
} Changing random source code options often has side effects.

I thought that change looked a bit questionable.  There aren't
very many of these kinds of preprocessor directives that it's
appropriate to define unconditionally, and I don't see any
reason to remove the #if / _GNU_SOURCE definition, independent
of defining _POSIX_C_SOURCE.

} --- zsh-4.3.11/Src/system.h     2010-02-22 11:12:31.000000000 +0100
} +++ zsh/Src/system.h    2011-04-12 14:20:37.106000061 +0200
} @@ -37,13 +37,12 @@
}  #endif
}  #endif
} 
} -#if defined(__linux) || defined(__GNU__) || defined(__GLIBC__)
}  /*
}   * Turn on numerous extensions.
}   * This is in order to get the functions for manipulating /dev/ptmx.
}   */
}  #define _GNU_SOURCE 1
} -#endif
} +#define _POSIX_C_SOURCE 200809L

-- 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] define _GNU_SOURCE
  2011-04-12 13:09 [PATCH v2] define _GNU_SOURCE Valentin Ochs
  2011-04-13 16:10 ` build on os x 10.6.7, xcode 3.2.6 S. Cowles
@ 2011-04-14  8:35 ` Peter Stephenson
  2011-04-14  9:03   ` Peter Stephenson
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Stephenson @ 2011-04-14  8:35 UTC (permalink / raw)
  To: Valentin Ochs; +Cc: zsh-workers

On Tue, 12 Apr 2011 15:09:32 +0200
Valentin Ochs <a@0au.de> wrote:
> -#if defined(__linux) || defined(__GNU__) || defined(__GLIBC__)
>  /*
>   * Turn on numerous extensions.
>   * This is in order to get the functions for manipulating /dev/ptmx.
>   */
>  #define _GNU_SOURCE 1
> -#endif
> +#define _POSIX_C_SOURCE 200809L

Looks like we'll need to #ifdef these for the appropriate system, since
it's causing mayhem elsewhere.  Can you provide a preprocessor test for
the system you're fixing?

Thanks.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] define _GNU_SOURCE
  2011-04-14  8:35 ` [PATCH v2] define _GNU_SOURCE Peter Stephenson
@ 2011-04-14  9:03   ` Peter Stephenson
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Stephenson @ 2011-04-14  9:03 UTC (permalink / raw)
  To: zsh-workers; +Cc: Valentin Ochs

On Thu, 14 Apr 2011 09:35:23 +0100
Peter Stephenson <Peter.Stephenson@csr.com> wrote:

> On Tue, 12 Apr 2011 15:09:32 +0200
> Valentin Ochs <a@0au.de> wrote:
> > -#if defined(__linux) || defined(__GNU__) || defined(__GLIBC__)
> >  /*
> >   * Turn on numerous extensions.
> >   * This is in order to get the functions for
> > manipulating /dev/ptmx. */
> >  #define _GNU_SOURCE 1
> > -#endif
> > +#define _POSIX_C_SOURCE 200809L
> 
> Looks like we'll need to #ifdef these for the appropriate system,
> since it's causing mayhem elsewhere.  Can you provide a preprocessor
> test for the system you're fixing?

I couldn't see anything obvious in musl to test for.  For, I'll make it
so that it can be explicitly enabled with configure --enable-libc-musl.

Index: configure.ac
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.ac,v
retrieving revision 1.133
diff -p -u -r1.133 configure.ac
--- configure.ac	12 Apr 2011 14:51:31 -0000	1.133
+++ configure.ac	14 Apr 2011 09:01:45 -0000
@@ -2466,6 +2466,17 @@ if test x$zsh_cv_c_unicode_support = xye
 fi
 
 dnl
+dnl musl support
+dnl
+AH_TEMPLATE([LIBC_MUSL],
+[Define to 1 if musl is being used as the C library])
+AC_ARG_ENABLE(libc-musl,
+AC_HELP_STRING([--enable-libc-musl], [compile with musl as the C library]),
+[if test x$enableval = xyes; then
+  AC_DEFINE(LIBC_MUSL)
+fi])
+
+dnl
 dnl static user lookup
 dnl
 AC_ARG_ENABLE(dynamic-nss,
Index: Src/system.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/system.h,v
retrieving revision 1.57
diff -p -u -r1.57 system.h
--- Src/system.h	12 Apr 2011 14:51:33 -0000	1.57
+++ Src/system.h	14 Apr 2011 09:01:45 -0000
@@ -37,12 +37,16 @@
 #endif
 #endif
 
+#if defined(__linux) || defined(__GNU__) || defined(__GLIBC__) || defined(LIBC_MUSL)
 /*
  * Turn on numerous extensions.
  * This is in order to get the functions for manipulating /dev/ptmx.
  */
 #define _GNU_SOURCE 1
+#endif
+#ifdef LIBC_MUSL
 #define _POSIX_C_SOURCE 200809L
+#endif
 
 /* NeXT has half-implemented POSIX support *
  * which currently fools configure         */


-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-04-14  9:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-12 13:09 [PATCH v2] define _GNU_SOURCE Valentin Ochs
2011-04-13 16:10 ` build on os x 10.6.7, xcode 3.2.6 S. Cowles
2011-04-13 16:26   ` Peter Stephenson
2011-04-13 19:32     ` S. Cowles
2011-04-13 19:56     ` Bart Schaefer
2011-04-14  8:35 ` [PATCH v2] define _GNU_SOURCE Peter Stephenson
2011-04-14  9:03   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).