Go to file
Thomas Petazzoni 47764b0be4 libfastjson: indicate explicitly which gcc -std option to use
This commit fixes the following build issue of libfastjson with old
enough compilers (4.8) and wchar disabled:

json_object.c: In function 'fjson_object_object_delete':
json_object.c:385:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (int i = 0 ; i < FJSON_OBJECT_CHLD_PG_SIZE ; ++i) {
   ^

The code of libfastjson requires C99. If your compiler is recent
enough (gcc 5.x), then no problem, it is C99 by default, no additional
flags are needed.

If your compiler is older (for example gcc 4.8), then -std=c99 or
-std=gnu99 is explicitly needed to tell the compiler to accept C99
constructs. Testing the compiler for the availability of such flags is
done by libfastjson configure script. However, the test program used
by the configure script uses some wchar_t types, and therefore the
test checking for C99 availability fails on toolchains with wchar
disabled. From config.log:

configure:3928: checking for /home/test/buildroot/output/host/usr/bin/i586-buildroot-linux-uclibc-gcc option to accept ISO C99
[...]
configure:4077: /home/test/buildroot/output/host/usr/bin/i586-buildroot-linux-uclibc-gcc -std=gnu99 -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 conftest.c >&5
conftest.c:54:3: error: unknown type name 'wchar_t'
   const wchar_t *name;
   ^

So, just like we did in libv4l in commit
f01396a158 ("libv4l: fix uclibc-ng
configure/compile"), let's hint directly the configure script that it
should use -std=gnu99. This fixes the build of libfastjson with old
compilers and wchar disabled.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
(cherry picked from commit 90430237cc)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2017-11-27 10:34:25 +01:00
arch arch/arm: add big.LITTLE cpu variants 2017-07-22 23:29:24 +02:00
board wandboard: genimage: Pass an offset for the rootfs 2017-10-16 23:38:12 +02:00
boot grub2: force -fno-stack-protector in CFLAGS 2017-08-30 22:09:21 +02:00
configs configs/minnowboard_max-graphical: wchar/grub2 fix 2017-10-16 23:02:52 +02:00
docs docs/manual: fix BR2_EXTERNAL path typo 2017-10-17 10:53:06 +02:00
fs fs: add missing $$(sep) to pre- and post-command hooks code 2017-11-26 21:23:34 +01:00
linux linux: bump cip version to v4.4.83-cip8 2017-10-16 22:53:56 +02:00
package libfastjson: indicate explicitly which gcc -std option to use 2017-11-27 10:34:25 +01:00
support suport/download: force svn to be non-interactive 2017-11-26 22:00:53 +01:00
system skeleton: Rename skeleton-sysv to skeleton-init-sysv 2017-08-14 21:52:45 +02:00
toolchain toolchain: detect external glibc in merged /usr 2017-10-16 23:21:55 +02:00
utils utils/readme.txt: add documentation of genrandconfig 2017-07-29 15:41:09 +02:00
.defconfig arch: remove support for sh64 2016-09-08 22:15:15 +02:00
.gitignore
.gitlab-ci.yml board: remove Armadeus's APF9328 support 2017-08-21 23:23:16 +02:00
.gitlab-ci.yml.in .gitlab-ci.yml: use large timeouts for runtime tests 2017-08-10 10:08:55 +02:00
CHANGES Update for 2017.08.1 2017-10-23 23:41:14 +02:00
Config.in Config.in: fix help comment for gcc optimization 2017-10-23 00:25:48 +02:00
Config.in.legacy package/simicsfs: remove package 2017-08-30 22:16:37 +02:00
COPYING
DEVELOPERS package/simicsfs: remove package 2017-08-30 22:16:37 +02:00
Makefile core/reproducible: do not override SOURCE_DATE_EPOCH 2017-11-26 20:49:13 +01:00
Makefile.legacy Remove BR2_DEPRECATED 2016-10-15 23:14:45 +02:00
README

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on Freenode IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches