Skip to contentSkip to conversation

building cross_tools, _POSIX_C_SOURCE and _XOPEN_SOURCE are redefined

U-Boot Robert P. J. Day 4 participants 5 messages Mar 15, 2017 – Mar 28, 2017

lore
Share & tools
lore
#0 lore raw

to build cross_tools, i ran:

  $ make sandbox_defconfig
  $ make cross_tools

and while it appeared to work, i got:

... snip ...

LDFLAGS="" python ./lib/libfdt/setup.py \
"-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DCONFIG_FIT_SIGNATURE -include ./include/libfdt_env.h -idirafterinclude -idirafter./arch/sandbox/include -I./lib/libfdt -I./tools -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -D_GNU_SOURCE " lib/libfdt/fdt.c lib/libfdt/fdt_ro.c lib/libfdt/fdt_rw.c lib/libfdt/fdt_strerror.c lib/libfdt/fdt_wip.c lib/libfdt/fdt_region.c lib/libfdt/fdt_sw.c tools/libfdt_wrap.c
In file included from /usr/include/python2.7/pyconfig.h:6:0,

                 from /usr/include/python2.7/Python.h:8,
                 from tools/libfdt_wrap.c:143:

/usr/include/python2.7/pyconfig-64.h:1203:0: warning: "_POSIX_C_SOURCE" redefined
#define _POSIX_C_SOURCE 200112L
^
In file included from /usr/include/stdint.h:25:0,

                 from /usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/stdint.h:9,
                 from ././include/compiler.h:19,
                 from ././include/libfdt_env.h:12,
                 from <command-line>:0:
/usr/include/features.h:225:0: note: this is the location of the previous definition
 # define _POSIX_C_SOURCE 200809L
 ^
In file included from /usr/include/python2.7/pyconfig.h:6:0,
                 from /usr/include/python2.7/Python.h:8,
                 from tools/libfdt_wrap.c:143:
/usr/include/python2.7/pyconfig-64.h:1225:0: warning: "_XOPEN_SOURCE" redefined
 #define _XOPEN_SOURCE 600
 ^
In file included from /usr/include/stdint.h:25:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/stdint.h:9,
                 from ././include/compiler.h:19,
                 from ././include/libfdt_env.h:12,
                 from <command-line>:0:
/usr/include/features.h:166:0: note: this is the location of the previous definition
 # define _XOPEN_SOURCE 700
 ^

not sure if that concerns anyone enough to want to tweak it.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#1 lore raw
Quoted 42 lines · Robert P. J. Day

to build cross_tools, i ran:

  $ make sandbox_defconfig
  $ make cross_tools

and while it appeared to work, i got:

... snip ...

LDFLAGS="" python ./lib/libfdt/setup.py \
"-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DCONFIG_FIT_SIGNATURE -include ./include/libfdt_env.h -idirafterinclude -idirafter./arch/sandbox/include -I./lib/libfdt -I./tools -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -D_GNU_SOURCE " lib/libfdt/fdt.c lib/libfdt/fdt_ro.c lib/libfdt/fdt_rw.c lib/libfdt/fdt_strerror.c lib/libfdt/fdt_wip.c lib/libfdt/fdt_region.c lib/libfdt/fdt_sw.c tools/libfdt_wrap.c
In file included from /usr/include/python2.7/pyconfig.h:6:0,

                 from /usr/include/python2.7/Python.h:8,
                 from tools/libfdt_wrap.c:143:

/usr/include/python2.7/pyconfig-64.h:1203:0: warning: "_POSIX_C_SOURCE" redefined
#define _POSIX_C_SOURCE 200112L
^
In file included from /usr/include/stdint.h:25:0,

                 from /usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/stdint.h:9,
                 from ././include/compiler.h:19,
                 from ././include/libfdt_env.h:12,
                 from <command-line>:0:
/usr/include/features.h:225:0: note: this is the location of the previous definition
 # define _POSIX_C_SOURCE 200809L
 ^
In file included from /usr/include/python2.7/pyconfig.h:6:0,
                 from /usr/include/python2.7/Python.h:8,
                 from tools/libfdt_wrap.c:143:
/usr/include/python2.7/pyconfig-64.h:1225:0: warning: "_XOPEN_SOURCE" redefined
 #define _XOPEN_SOURCE 600
 ^
In file included from /usr/include/stdint.h:25:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/stdint.h:9,
                 from ././include/compiler.h:19,
                 from ././include/libfdt_env.h:12,
                 from <command-line>:0:
/usr/include/features.h:166:0: note: this is the location of the previous definition
 # define _XOPEN_SOURCE 700
 ^
Quoted 1 line

not sure if that concerns anyone enough to want to tweak it.

This is the second report I've gotten about this. But, we don't set any of those things directly. It's something related to the python install you have. Can you please dig a bit more? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170317/0343bfbe/attachment.sig>
#4 lore raw
In reply to Robert P. J. Day

Hello Robert,

Am 15.03.2017 um 09:02 schrieb Robert P. J. Day:

Quoted 42 lines

to build cross_tools, i ran:

   $ make sandbox_defconfig
   $ make cross_tools

and while it appeared to work, i got:

... snip ...

LDFLAGS="" python ./lib/libfdt/setup.py \
"-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DCONFIG_FIT_SIGNATURE -include ./include/libfdt_env.h -idirafterinclude -idirafter./arch/sandbox/include -I./lib/libfdt -I./tools -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -D_GNU_SOURCE " lib/libfdt/fdt.c lib/libfdt/fdt_ro.c lib/libfdt/fdt_rw.c lib/libfdt/fdt_strerror.c lib/libfdt/fdt_wip.c lib/libfdt/fdt_region.c lib/libfdt/fdt_sw.c tools/libfdt_wrap.c
In file included from /usr/include/python2.7/pyconfig.h:6:0,

                  from /usr/include/python2.7/Python.h:8,
                  from tools/libfdt_wrap.c:143:

/usr/include/python2.7/pyconfig-64.h:1203:0: warning: "_POSIX_C_SOURCE" redefined
#define _POSIX_C_SOURCE 200112L
^
In file included from /usr/include/stdint.h:25:0,

                  from /usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/stdint.h:9,
                  from ././include/compiler.h:19,
                  from ././include/libfdt_env.h:12,
                  from <command-line>:0:
/usr/include/features.h:225:0: note: this is the location of the previous definition
  # define _POSIX_C_SOURCE 200809L
  ^
In file included from /usr/include/python2.7/pyconfig.h:6:0,
                  from /usr/include/python2.7/Python.h:8,
                  from tools/libfdt_wrap.c:143:
/usr/include/python2.7/pyconfig-64.h:1225:0: warning: "_XOPEN_SOURCE" redefined
  #define _XOPEN_SOURCE 600
  ^
In file included from /usr/include/stdint.h:25:0,
                  from /usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/stdint.h:9,
                  from ././include/compiler.h:19,
                  from ././include/libfdt_env.h:12,
                  from <command-line>:0:
/usr/include/features.h:166:0: note: this is the location of the previous definition
  # define _XOPEN_SOURCE 700
  ^
Quoted 1 line

not sure if that concerns anyone enough to want to tweak it.

I stumbled also over this, but did not find time to look into it...

So, if you have time for fixing it, that would be nice ;-)

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#2 lore raw
In reply to Tom Rini
Quoted 43 lines · Tom Rini
Quoted 42 lines · Robert P. J. Day

to build cross_tools, i ran:

  $ make sandbox_defconfig
  $ make cross_tools

and while it appeared to work, i got:

... snip ...

LDFLAGS="" python ./lib/libfdt/setup.py \
"-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DCONFIG_FIT_SIGNATURE -include ./include/libfdt_env.h -idirafterinclude -idirafter./arch/sandbox/include -I./lib/libfdt -I./tools -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -D_GNU_SOURCE " lib/libfdt/fdt.c lib/libfdt/fdt_ro.c lib/libfdt/fdt_rw.c lib/libfdt/fdt_strerror.c lib/libfdt/fdt_wip.c lib/libfdt/fdt_region.c lib/libfdt/fdt_sw.c tools/libfdt_wrap.c
In file included from /usr/include/python2.7/pyconfig.h:6:0,

                 from /usr/include/python2.7/Python.h:8,
                 from tools/libfdt_wrap.c:143:

/usr/include/python2.7/pyconfig-64.h:1203:0: warning: "_POSIX_C_SOURCE" redefined
#define _POSIX_C_SOURCE 200112L
^
In file included from /usr/include/stdint.h:25:0,

                 from /usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/stdint.h:9,
                 from ././include/compiler.h:19,
                 from ././include/libfdt_env.h:12,
                 from <command-line>:0:
/usr/include/features.h:225:0: note: this is the location of the previous definition
 # define _POSIX_C_SOURCE 200809L
 ^
In file included from /usr/include/python2.7/pyconfig.h:6:0,
                 from /usr/include/python2.7/Python.h:8,
                 from tools/libfdt_wrap.c:143:
/usr/include/python2.7/pyconfig-64.h:1225:0: warning: "_XOPEN_SOURCE" redefined
 #define _XOPEN_SOURCE 600
 ^
In file included from /usr/include/stdint.h:25:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/stdint.h:9,
                 from ././include/compiler.h:19,
                 from ././include/libfdt_env.h:12,
                 from <command-line>:0:
/usr/include/features.h:166:0: note: this is the location of the previous definition
 # define _XOPEN_SOURCE 700
 ^
Quoted 5 lines
Quoted 1 line

not sure if that concerns anyone enough to want to tweak it.

This is the second report I've gotten about this. But, we don't set any of those things directly. It's something related to the python install you have. Can you please dig a bit more? Thanks!

if no one else has figured out what is going on here, i'll try
poking around this weekend. but AFAIK, i haven't done anything out of the ordinary with my python installation.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#3 lore raw
Quoted 26 lines · Robert P. J. Day
Quoted 24 lines · Tom Rini
Quoted 22 lines · Robert P. J. Day
                 from ././include/libfdt_env.h:12,
                 from <command-line>:0:
/usr/include/features.h:225:0: note: this is the location of the previous definition
 # define _POSIX_C_SOURCE 200809L
 ^
In file included from /usr/include/python2.7/pyconfig.h:6:0,
                 from /usr/include/python2.7/Python.h:8,
                 from tools/libfdt_wrap.c:143:
/usr/include/python2.7/pyconfig-64.h:1225:0: warning: "_XOPEN_SOURCE" redefined
 #define _XOPEN_SOURCE 600
 ^
In file included from /usr/include/stdint.h:25:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/stdint.h:9,
                 from ././include/compiler.h:19,
                 from ././include/libfdt_env.h:12,
                 from <command-line>:0:
/usr/include/features.h:166:0: note: this is the location of the previous definition
 # define _XOPEN_SOURCE 700
 ^

not sure if that concerns anyone enough to want to tweak it.

Quoted 7 lines
Quoted 3 lines

This is the second report I've gotten about this. But, we don't set any of those things directly. It's something related to the python install you have. Can you please dig a bit more? Thanks!

if no one else has figured out what is going on here, i'll try
poking around this weekend. but AFAIK, i haven't done anything out of the ordinary with my python installation.

The issue is that Python.h has to be included before the rest of the header files. As can be read in the Python documentation:

"Note Since Python may define some pre-processor definitions which affect the standard headers on some systems, you must include Python.h before any standard headers are included." [1]

I have no idea how to achieve this though in u-boot.

[1] https://docs.python.org/3/c-api/intro.html#includes

Signature · 1 line
Jelle van der Waa