Skip to content

[testsuite] "newlib.wctype/twctrans.c" fails #20

@shahab-vahedi

Description

@shahab-vahedi

Problem

When running Newlib's testsuite, the newlib.wctype/twctrans.c test fails:

...
Running /.../newlib/testsuite/newlib.wctype/wctype.exp ...
FAIL: newlib.wctype/twctrans.c compilation
UNRESOLVED: newlib.wctype/twctrans.c execution
PASS: newlib.wctype/tiswctype.c compilation
...

The problem is the missing references to _jp2uc_l and _uc2jp_l:

arc-elf32-gcc /src/newlib/newlib/testsuite/newlib.wctype/twctrans.c \
              newlib_tg.o                                           \
              -I/build/newlib/arc-elf32/newlib/targ-include         \
              -I/build/newlib/arc-elf32/newlib                      \
              -I/src/newlib/newlib/libc/include                     \
              -B/build/newlib/arc-elf32/libgloss/arc/               \
              -L/build/newlib/arc-elf32/libgloss/arc                \
              -L/src/newlib/libgloss/arc                            \
              --specs=qemu.specs                                    \
              -Wl,--defsym=__DEFAULT_HEAP_SIZE=256m                 \
              -Wl,--defsym=__DEFAULT_STACK_SIZE=32m                 \
              -B/build/newlib/arc-elf32/newlib                      \
              -L/build/newlib/arc-elf32/newlib                      \
              -Wl,-wrap,exit                                        \
              -Wl,-wrap,_exit                                       \
              -Wl,-wrap,main                                        \
              -Wl,-wrap,abort                                       \
              -I/src/newlib/newlib/testsuite/include                \
              -lm                                                   \
              -o /build/newlib/arc-elf32/newlib/testsuite/twctrans.x

/install/arc-elf32/bin/ld: /build/newlib/arc-elf32/newlib/libc.a(lib_a-towctrans_l.o): in function 'towctrans_l':
/src/newlib/newlib/libc/ctype/towctrans_l.c:145: undefined reference to '_jp2uc_l'
/install/arc-elf32/bin/ld: /src/newlib/newlib/libc/ctype/towctrans_l.c:145: undefined reference to '_jp2uc_l'
/install/arc-elf32/bin/ld: /src/newlib/newlib/libc/ctype/towctrans_l.c:159: undefined reference to '_uc2jp_l'
/install/arc-elf32/bin/ld: /src/newlib/newlib/libc/ctype/towctrans_l.c:159: undefined reference to '_uc2jp_l'
collect2: error: ld returned 1 exit status
compiler exited with status 1

Running the Newlib testsuite inside its build directory

$ module load <your_toolchain>
$ module load <simulator>
$ cd /bld/newlib/arc-elf32/newlib
$ make check-DEJAGNU
$ cd testsuite
$ echo << EOF >> site.exp
set target_list arc-sim-nsimdrv
set arc_board_dir "$env(COMPSRC)/toolchain"
if [info exists boards_dir] {
    lappend boards_dir "$arc_board_dir/dejagnu"
    lappend boards_dir "$arc_board_dir/dejagnu/baseboards"
} else {
    set boards_dir "$arc_board_dir/dejagnu"
    lappend boards_dir "$arc_board_dir/dejagnu/baseboards"
}
EOF
$ runtest

Version info

$ cd /src
$ git clone https://github.com/foss-for-synopsys-dwc-arc-processors/newlib.git
$ cd newlib
$ git checkout origin/arc-2021.03
$ git describe
arc-2021.03-eng002-4-g22d463abd
$ git log --pretty=oneline --abbrev-commit
22d463abd [libgloss/arc] Declutter the Makefile.in

Building commands

$ /src/newlib/configure --target=arc-elf32        \
                        --with-cpu=archs          \
                        --disable-multilib        \
                        --enable-fast-install=N/A \
                        --with-endian=little      \
                        --disable-werror          \
                        --enable-languages=c,c++  \
                        --disable-shared          \
                        --disable-tls             \
                        --disable-threads         \
                        --prefix=/install         \
                        --with-gnu-as             \
                        --with-gnu-ld
$ make -j $(nproc)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions