[PATCH 0/2] GCC errors when building C++ Applications with libbsd

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Sep 26 05:29:28 UTC 2022


Hello,

On 25/09/2022 22:08, kho237115 at gmx.de wrote:
> From: kaidoho<kho237115 at gmx.de>
> 
> Dear all, I am using the latest RTEMS 6 tools and sources. When building a C++ application including libbsd I receive two errors from GCC.

thanks for your patches. Could you please change your Git configuration 
so that your full name is present as the patch author.

> 
> The first one complains about the macro BITSET_DEFINE within freebsd/sys/sys/_domainset.h. I think this relates to a patch "sys/bitset.h: reduce 
> visibility of BIT_* macros" within the freebsd sourcehttps://github.com/freebsd/freebsd-src/commit/5e04571cf3cf4024be926976a6abf19626df30be.
> I ve simply changed BITSET_DEFINE to __BITSET_DEFINE as shown in the patch. This makes compilation work on my side, but there are a few other occurences of
> BITSET_DEFINE within rtems and libbsd.

This change is fine. It is already fixed like this in the FreeBSD 
upstream. Please send the patch again with a proper author name.

> 
> The second one is triggered by the function getrusage in rtemsbsd/include/bsd/sys/ressource.h.
> There is a another declaration in include/sys/ressource.h provided with the toolchain.
> Now, one has C Linkage the other one C++ Linkage which leads to a conflict. I ve simply made the one in libbsd invisible to the C++ compiler.

This is a bug in Newlib (newlib/libc/include/sys/resource.h). This file 
needs the C++ extern "C" stuff.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list