#2982 closed defect (invalid)

LibBSD broken with GCC+RTEMS changes

Reported by: Chris Johns Owned by: Sebastian Huber
Priority: highest Milestone: 5.1
Component: tool/gcc Version: 5
Severity: critical Keywords:
Cc: Blocked By:
Blocking:

Description

The RTEMS Header test is libbsd is broken. I assume including <rtems.h> and no other is still a requirement. Maybe we need a test for this.

The example code is:

$ cat t.c
/*

/opt/work/rtems/4.12/bin/arm-rtems4.12-gcc -qrtems -B/opt/work/si/rtems/4.12/arm-rtems4.12/lib -B/opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/ --specs bsp_specs -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9 -ffunction-sections -fdata-sections -DHAVE_RTEMS_SCORE_CPUOPTS_H=1 t.c -c -o t.o

*/

#include <rtems.h>

int main(int argc, char **argv) {
        (void)argc; (void)argv;
        return 0;
}
$ /opt/work/rtems/4.12/bin/arm-rtems4.12-gcc -qrtems -B/opt/work/si/rtems/4.12/arm-rtems4.12/lib -B/opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/ --specs bsp_specs -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9 -ffunction-sections -fdata-sections -DHAVE_RTEMS_SCORE_CPUOPTS_H=1 t.c -c -o t.o
In file included from /opt/work/rtems/4.12/arm-rtems4.12/include/signal.h:6:0,
                 from /opt/work/rtems/4.12/arm-rtems4.12/include/time.h:178,
                 from /opt/work/rtems/4.12/arm-rtems4.12/include/sys/time.h:268,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/score/timestamp.h:43,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/score/thread.h:36,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/score/heap.h:22,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/rtems/types.h:26,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems.h:31,
                 from t.c:7:
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/signal.h:53:3: error: unknown type name 'pthread_attr_t'
   pthread_attr_t  *sigev_notify_attributes;    /* Notification Attributes */
   ^~~~~~~~~~~~~~
In file included from /opt/work/rtems/4.12/arm-rtems4.12/include/string.h:10:0,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/score/basedefs.h:49,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/score/types.h:23,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/score/cpu.h:32,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/system.h:23,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems.h:29,
                 from t.c:7:
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/signal.h:202:5: error: unknown type name 'pthread_t'
 int _EXFUN(pthread_kill, (pthread_t thread, int sig));
     ^
In file included from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/rtems/config.h:25:0,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/config.h:57,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems.h:33,
                 from t.c:7:
/opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/rtems/tasks.h:425:3: error: unknown type name 'cpu_set_t'
   cpu_set_t           *cpuset
   ^~~~~~~~~
/opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/rtems/tasks.h:458:9: error: unknown type name 'cpu_set_t'
   const cpu_set_t *cpuset
         ^~~~~~~~~
/opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/rtems/tasks.h:581:3: error: unknown type name 'cpu_set_t'
   cpu_set_t *cpuset
   ^~~~~~~~~
$ cat t.cpp
/*

/opt/work/rtems/4.12/bin/arm-rtems4.12-g++ -qrtems -B/opt/work/si/rtems/4.12/arm-rtems4.12/lib -B/opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/ --specs bsp_specs -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9 -ffunction-sections -fdata-sections -DHAVE_RTEMS_SCORE_CPUOPTS_H=1 t.cpp -c -o t.o

*/

#include <rtems.h>

int main(int argc, char **argv) {
        (void)argc; (void)argv;
        return 0;
}
$ /opt/work/rtems/4.12/bin/arm-rtems4.12-g++ -qrtems -B/opt/work/si/rtems/4.12/arm-rtems4.12/lib -B/opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/ --specs bsp_specs -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9 -ffunction-sections -fdata-sections -DHAVE_RTEMS_SCORE_CPUOPTS_H=1 t.cpp -c -o t.o
In file included from /opt/work/rtems/4.12/arm-rtems4.12/include/signal.h:6:0,
                 from /opt/work/rtems/4.12/arm-rtems4.12/include/time.h:178,
                 from /opt/work/rtems/4.12/arm-rtems4.12/include/sys/time.h:268,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/score/timestamp.h:43,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/score/thread.h:36,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/score/heap.h:22,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/rtems/types.h:26,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems.h:31,
                 from t.cpp:7:
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/signal.h:53:3: error: 'pthread_attr_t' does not name a type
   pthread_attr_t  *sigev_notify_attributes;    /* Notification Attributes */
   ^~~~~~~~~~~~~~
In file included from /opt/work/rtems/4.12/arm-rtems4.12/include/string.h:10:0,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/score/basedefs.h:49,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/score/types.h:23,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/score/cpu.h:32,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/system.h:23,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems.h:29,
                 from t.cpp:7:
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/signal.h:202:5: error: 'pthread_t' was not declared in this scope
 int _EXFUN(pthread_kill, (pthread_t thread, int sig));
     ^
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/signal.h:202:5: error: expected primary-expression before 'int'
 int _EXFUN(pthread_kill, (pthread_t thread, int sig));
     ^
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/signal.h:202:5: error: expression list treated as compound expression in initializer [-fpermissive]
 int _EXFUN(pthread_kill, (pthread_t thread, int sig));
     ^
In file included from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/rtems/config.h:25:0,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/config.h:57,
                 from /opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems.h:33,
                 from t.cpp:7:
/opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/rtems/tasks.h:425:3: error: 'cpu_set_t' has not been declared
   cpu_set_t           *cpuset
   ^~~~~~~~~
/opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/rtems/tasks.h:458:9: error: 'cpu_set_t' does not name a type
   const cpu_set_t *cpuset
         ^~~~~~~~~
/opt/work/si/rtems/4.12/arm-rtems4.12/xilinx_zynq_zc706/lib/include/rtems/rtems/tasks.h:581:3: error: 'cpu_set_t' has not been declared
   cpu_set_t *cpuset
   ^~~~~~~~~

Note: The header test in libbsd is currently using C++ and I am not sure why.

Change History (4)

comment:1 Changed on Apr 6, 2017 at 12:29:07 AM by Chris Johns

Owner: changed from joel.sherrill@… to Sebastian Huber
Status: newassigned

comment:2 Changed on Apr 6, 2017 at 2:17:54 AM by Chris Johns

Resolution: invalid
Status: assignedclosed

I cleaned the install paths and rebuilt and I see no error.

comment:3 Changed on Oct 10, 2017 at 5:58:26 AM by Sebastian Huber

Component: GCCtool/gcc

comment:4 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.