Skip to contentSkip to conversation

package/libdrm: fix building if GCC's C standard is not gnu99

PATCH New Bernd Kuhls 5 participants 8 messages Jul 2, 2015 – Jul 4, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libdrm: fix building if GCC's C standard is not gnu99

Fixes
checking for /home/fli4l/buildroot/output/host/usr/bin/i586-buildroot-linux-uclibc-gcc option to accept ISO C99... unsupported
configure: error: Building libdrm requires C99 enabled compiler

using this defconfig
BR2_KERNEL_HEADERS_4_0=y
BR2_BINUTILS_VERSION_2_25=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_LIBDRM=y

Patch inspired by
http://git.buildroot.net/buildroot/commit/?id=5cf5b390385fb6325485e37dc9d38e1e3ac1f091

---
 package/libdrm/libdrm.mk |    2 ++
 1 file changed, 2 insertions(+)
package/libdrm/libdrm.mk +2 -0
index 4cca645..1768214 100644
@@ -19,6 +19,8 @@ LIBDRM_CONF_OPTS = \
 	--disable-cairo-tests \
 	--disable-manpages
 
+LIBDRM_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
+
 ifeq ($(BR2_PACKAGE_LIBDRM_INTEL),y)
 LIBDRM_CONF_OPTS += --enable-intel
 LIBDRM_DEPENDENCIES += libatomic_ops libpciaccess
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 package/libdrm: fix building if GCC's C standard is not gnu99

Bernd, all,

On 2015-07-02 20:05 +0200, Bernd Kuhls spake thusly:

Quoted 10 lines

Fixes
checking for /home/fli4l/buildroot/output/host/usr/bin/i586-buildroot-linux-uclibc-gcc option to accept ISO C99... unsupported
configure: error: Building libdrm requires C99 enabled compiler

using this defconfig
BR2_KERNEL_HEADERS_4_0=y
BR2_BINUTILS_VERSION_2_25=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_LIBDRM=y

Quoted 4 lines

Patch inspired by
http://git.buildroot.net/buildroot/commit/?id=5cf5b390385fb6325485e37dc9d38e1e3ac1f091

Regards,
Yann E. MORIN.

Quoted 24 lines
---
 package/libdrm/libdrm.mk |    2 ++
 1 file changed, 2 insertions(+)
package/libdrm/libdrm.mk +2 -0
index 4cca645..1768214 100644
@@ -19,6 +19,8 @@ LIBDRM_CONF_OPTS = \
 	--disable-cairo-tests \
 	--disable-manpages
 
+LIBDRM_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
+
 ifeq ($(BR2_PACKAGE_LIBDRM_INTEL),y)
 LIBDRM_CONF_OPTS += --enable-intel
 LIBDRM_DEPENDENCIES += libatomic_ops libpciaccess
Signature · 6 lines
1.7.10.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 package/libdrm: fix building if GCC's C standard is not gnu99

In reply to Bernd Kuhls

Hello Bernd,

Quoted 23 lines · Bernd Kuhls

Fixes
checking for /home/fli4l/buildroot/output/host/usr/bin/i586-buildroot-linux-uclibc-gcc option to accept ISO C99... unsupported
configure: error: Building libdrm requires C99 enabled compiler

using this defconfig
BR2_KERNEL_HEADERS_4_0=y
BR2_BINUTILS_VERSION_2_25=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_LIBDRM=y

Patch inspired by
http://git.buildroot.net/buildroot/commit/?id=5cf5b390385fb6325485e37dc9d38e1e3ac1f091

---
 package/libdrm/libdrm.mk |    2 ++
 1 file changed, 2 insertions(+)
package/libdrm/libdrm.mk +0 -0
index 4cca645..1768214 100644

package/libdrm/libdrm.mk LIBDRM_CONF_OPTS = \ · line 26

Quoted 8 lines
package/libdrm/libdrm.mk +2 -0
@@ -19,6 +19,8 @@ LIBDRM_CONF_OPTS = \
 	--disable-cairo-tests \
 	--disable-manpages
 
+LIBDRM_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
+
 ifeq ($(BR2_PACKAGE_LIBDRM_INTEL),y)
 LIBDRM_CONF_OPTS += --enable-intel
 LIBDRM_DEPENDENCIES += libatomic_ops libpciaccess

Same problem with libv4l (with raspberrypi_defconfig):

libv4l2rds.c:256:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode

    for (int i = 0; i < tuning->station_cnt; i++) {
    ^

libv4l2rds.c:256:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code

From build/libv4l-1.6.2/config.log:

configure:4709: checking for .../host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc option to accept ISO C99
configure:4858: .../host/usr/bin/arm-buildroot-linux-uclibcgnueabi-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:9: error: unknown type name 'wchar_t'
const wchar_t *name;

The C99 detection problem seems more related to missing wchar_t type support than the compiler option?

Adding LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=c99' gives a lot of compile errors like:

libv4lconvert.c: In function 'dev_ioctl':
processing/../libv4lsyscall-priv.h:85:10: error: 'SYS_ioctl' undeclared (first use in this function)
syscall(SYS_ioctl, (int)(fd), (unsigned long)(cmd), (void *)(arg))

          ^
libv4lconvert.c:43:9: note: in expansion of macro 'SYS_IOCTL'
  return SYS_IOCTL(fd, cmd, arg);
         ^
processing/../libv4lsyscall-priv.h:85:10: note: each undeclared identifier is reported only once for each function it appears in
  syscall(SYS_ioctl, (int)(fd), (unsigned long)(cmd), (void *)(arg))
          ^
libv4lconvert.c:43:9: note: in expansion of macro 'SYS_IOCTL'
  return SYS_IOCTL(fd, cmd, arg);
         ^

Adding LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99' solves all configure/compile errors.

Maybe it is a uclibc-ng and/or autoconf related problem (and there is a better/more general) solution other than to overwrite ac_cv_prog_cc_c99 for a lot of packages?

Regards,
Peter

#3 lore raw

PATCH 1/1 package/libdrm: fix building if GCC's C standard is not gnu99

On 07/02/15 23:12, Peter Seiderer wrote:
[snip]

Quoted 9 lines

From build/libv4l-1.6.2/config.log:

configure:4709: checking for .../host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc option to accept ISO C99
configure:4858: .../host/usr/bin/arm-buildroot-linux-uclibcgnueabi-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:9: error: unknown type name 'wchar_t'
const wchar_t *name;

The C99 detection problem seems more related to missing wchar_t type support than the compiler option?

Good catch!

[Adding Waldemar for uClibc input]

The configure script does include wchar.h, but it seems that wchar_t doesn't
get defined after all... Waldemar, any idea?

Regards,
Arnout

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#4 lore raw

PATCH 1/1 package/libdrm: fix building if GCC's C standard is not gnu99

Arnout, All,

On 2015-07-02 23:46 +0200, Arnout Vandecappelle spake thusly:

Quoted 10 lines · Peter Seiderer

[snip]

Quoted 8 lines

From build/libv4l-1.6.2/config.log:

configure:4709: checking for .../host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc option to accept ISO C99
configure:4858: .../host/usr/bin/arm-buildroot-linux-uclibcgnueabi-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:9: error: unknown type name 'wchar_t'
const wchar_t *name;

Quoted 8 lines
Quoted 1 line

The C99 detection problem seems more related to missing wchar_t type support than the compiler option?

Good catch!

[Adding Waldemar for uClibc input]

The configure script does include wchar.h, but it seems that wchar_t doesn't
get defined after all... Waldemar, any idea?

No wchar support in the toolchain, maybe?

Peter, can you confirm your toolchain is missing wchar (BR2_USE_WCHAR)?

Note: I am *not* saying those packages should depend on whar, just that this would explain the failing (and broken!) autoconf test.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH 1/1 package/libdrm: fix building if GCC's C standard is not gnu99

Hello Yann,

Quoted 17 lines · Yann E. MORIN

Arnout, All,

On 2015-07-02 23:46 +0200, Arnout Vandecappelle spake thusly:

Quoted 14 lines · Peter Seiderer

[snip]

Quoted 9 lines

From build/libv4l-1.6.2/config.log:

configure:4709: checking for .../host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc option to accept ISO C99
configure:4858: .../host/usr/bin/arm-buildroot-linux-uclibcgnueabi-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:9: error: unknown type name 'wchar_t'
const wchar_t *name;

The C99 detection problem seems more related to missing wchar_t type support than the compiler option?

Good catch!

Quoted 9 lines
Quoted 4 lines

[Adding Waldemar for uClibc input]

The configure script does include wchar.h, but it seems that wchar_t doesn't
get defined after all... Waldemar, any idea?

No wchar support in the toolchain, maybe?

Peter, can you confirm your toolchain is missing wchar (BR2_USE_WCHAR)?

Used up to date raspberrypi_defconfig, no wchar support enabled:
# BR2_TOOLCHAIN_BUILDROOT_WCHAR is not set

Regards,
Peter

Quoted 6 lines

Note: I am *not* saying those packages should depend on whar, just that this would explain the failing (and broken!) autoconf test.

Regards,
Yann E. MORIN.

#6 lore raw

PATCH 1/1 package/libdrm: fix building if GCC's C standard is not gnu99

Peter, All,

On 2015-07-03 00:19 +0200, Peter Seiderer spake thusly:

Quoted 21 lines · Yann E. MORIN
Quoted 20 lines

On 2015-07-02 23:46 +0200, Arnout Vandecappelle spake thusly:

Quoted 18 lines · Peter Seiderer

[snip]

Quoted 9 lines

From build/libv4l-1.6.2/config.log:

configure:4709: checking for .../host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc option to accept ISO C99
configure:4858: .../host/usr/bin/arm-buildroot-linux-uclibcgnueabi-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:9: error: unknown type name 'wchar_t'
const wchar_t *name;

The C99 detection problem seems more related to missing wchar_t type support than the compiler option?

Good catch!

[Adding Waldemar for uClibc input]

The configure script does include wchar.h, but it seems that wchar_t doesn't
get defined after all... Waldemar, any idea?

Quoted 6 lines
Quoted 4 lines

No wchar support in the toolchain, maybe?

Peter, can you confirm your toolchain is missing wchar (BR2_USE_WCHAR)?

Used up to date raspberrypi_defconfig, no wchar support enabled:

Note that I just updated it two days ago. ;-)

Quoted 1 line

# BR2_TOOLCHAIN_BUILDROOT_WCHAR is not set

OK, thanks; that explains it.

Still ,that autoconf test is broken... :-(

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#7 lore raw

PATCH 1/1 package/libdrm: fix building if GCC's C standard is not gnu99

In reply to Bernd Kuhls

Dear Bernd Kuhls,

Quoted 10 lines · Bernd Kuhls

Fixes
checking for /home/fli4l/buildroot/output/host/usr/bin/i586-buildroot-linux-uclibc-gcc option to accept ISO C99... unsupported
configure: error: Building libdrm requires C99 enabled compiler

using this defconfig
BR2_KERNEL_HEADERS_4_0=y
BR2_BINUTILS_VERSION_2_25=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_LIBDRM=y

Quoted 7 lines

Patch inspired by
http://git.buildroot.net/buildroot/commit/?id=5cf5b390385fb6325485e37dc9d38e1e3ac1f091

---
 package/libdrm/libdrm.mk |    2 ++
 1 file changed, 2 insertions(+)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com