tech-userlevel archive

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

Re: refine of the GSOC project



Well, your saying of _NETBSD_SOURCE is defined by default seems correct,
I compiled a file in the benchmark separately which has the problem of
accessing
macro SA_ONSTACK
<http://nxr.netbsd.org/source/s?refs=SA_ONSTACK&project=src>  which lives
in <signal.h>. There is no problem in executing.
However, I am still not convinced why _NETBSD_SOURCE does not take effect
in the benchmark execution? There is no #undef _NETBSD_SOURCE in the
benchmark,
also defining other macros will not affect _NETBSD_SOURCE (it will make
multiple macros
exist simultaneously). I am not quite clear why the default _NETBSD_SOURCE
does not
work in the benchmark.

this is from <signal.h>, benchmark using SA_ONSTACK reporting this macro
not found.

#*if* (*defined*(_XOPEN_SOURCE
<http://nxr.netbsd.org/source/s?defs=_XOPEN_SOURCE&project=src>) &&
*defined*(_XOPEN_SOURCE_EXTENDED
<http://nxr.netbsd.org/source/s?defs=_XOPEN_SOURCE_EXTENDED&project=src>))
|| \    146  <http://nxr.netbsd.org/xref/src/sys/sys/signal.h#146>
(_XOPEN_SOURCE <http://nxr.netbsd.org/source/s?defs=_XOPEN_SOURCE&project=src>
- 0) >= 500 || *defined*(_NETBSD_SOURCE
<http://nxr.netbsd.org/source/s?defs=_NETBSD_SOURCE&project=src>)
147  <http://nxr.netbsd.org/xref/src/sys/sys/signal.h#147>#*define*
SA_ONSTACK <http://nxr.netbsd.org/source/s?refs=SA_ONSTACK&project=src>	0x0001	/*
take signal on signal stack */    148
<http://nxr.netbsd.org/xref/src/sys/sys/signal.h#148>#*define*
SA_RESTART <http://nxr.netbsd.org/source/s?refs=SA_RESTART&project=src>	0x0002	/*
restart system call on signal return */    149
<http://nxr.netbsd.org/xref/src/sys/sys/signal.h#149>#*define*
SA_RESETHAND <http://nxr.netbsd.org/source/s?refs=SA_RESETHAND&project=src>	0x0004	/*
reset to SIG_DFL when taking signal */    150
<http://nxr.netbsd.org/xref/src/sys/sys/signal.h#150>#*define*
SA_NODEFER <http://nxr.netbsd.org/source/s?refs=SA_NODEFER&project=src>	0x0010	/*
don't mask the signal we're delivering */    151
<http://nxr.netbsd.org/xref/src/sys/sys/signal.h#151>#*endif* /*
_XOPEN_SOURCE_EXTENDED || XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */



2016-05-12 9:57 GMT-07:00 Christos Zoulas <christos%zoulas.com@localhost>:

> On May 12,  9:22am, charles.cui1984%gmail.com@localhost (Charles Cui) wrote:
> -- Subject: Re: refine of the GSOC project
>
> | For the errors in the second list, I applied part of your change, which
> is
> | -lpthread -lrt -lm linked flags.
> | I did not apply other changes in the patch, but if applied, most of
> errors
> | in the second list will disappear.
> | Besides, I used -D_NETBSD_SOURCE to make some variables accessible.
> | Why do you think we should not use it?  Some kernel source has the code
> of
> | if defined _NETBSD_SOURCE || defined _XOPEN_SOURCE
> | /// define some variable here, say it is called foo
> | the benchmark reference foo, so we need to either enable  _NETBSD_SOURCE
> or
> | _XOPEN_SOURCE, right?
> |
> | also, in the LDFLAGS files of the benchmark suite, there are two comments
> | #Recommended flags:
> | #-D_XOPEN_SOURCE=600 -lpthread -lrt -lm
> |
> | It seems benchmark authors think users should enable _XOPEN_SOURCE.
> | Let me know if there are problems.
>
> In the standard environment, without any _FOO_SOURCE defined,
> _NETBSD_SOURCE
> is defined by default. If you need to add it, this means that something
> else
> is defining _FOO_SOURCE, thus changing the default compilation environment.
> FOO in this case could be POSIX/XOPEN etc.
>
> christos
>


Home | Main Index | Thread Index | Old Index