[RTEMS Project] #2982: LibBSD broken with GCC+RTEMS changes

RTEMS trac trac at rtems.org
Thu Apr 6 00:21:53 UTC 2017


#2982: LibBSD broken with GCC+RTEMS changes
-------------------------+-----------------------------
 Reporter:  Chris Johns  |      Owner:  joel.sherrill@…
     Type:  defect       |     Status:  new
 Priority:  highest      |  Milestone:  4.12.0
Component:  GCC          |    Version:  4.12
 Severity:  critical     |   Keywords:
-------------------------+-----------------------------
 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.

--
Ticket URL: <http://devel.rtems.org/ticket/2982>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list