You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Faced an issue with -mcpu=em_mini while testing #231. Without -Os or with -mcpu=em program builds fine.
$ module load arc_gnu/2020.09-elf32
$ arc-elf32-gcc --version
arc-elf32-gcc (ARCompact/ARCv2 ISA elf32 toolchain 2020.09) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ cat bug.c
#include <stddef.h>
#include <string.h>
int test_newlib_argv(int argc, char **argv)
{
int i;
const char *test_argv[] = {"a", "b", NULL};
const int test_argc = sizeof(test_argv) / sizeof(char *);
for (i = 0; i < argc; i++) {
if (strcmp(argv[i], test_argv[i]) == 0)
return 1;
}
return 0;
}
int main()
{
char *argv[] = {"a", "b", NULL};
int argc = sizeof(argv) / sizeof(char *);
return test_newlib_argv(argc, argv);
}
$ arc-elf32-gcc -mcpu=em_mini -Os bug.c -o bug
/global/freeware/Linux/2.X/arc_gnu_2020.09-elf32/bin/../lib/gcc/arc-elf32/10.2.0/../../../../arc-elf32/bin/ld: /tmp/ccl8riw1.o: in function `test_newlib_argv':
bug.c:(.text+0x4): undefined reference to `__st_r13_to_r15'
/global/freeware/Linux/2.X/arc_gnu_2020.09-elf32/bin/../lib/gcc/arc-elf32/10.2.0/../../../../arc-elf32/bin/ld: bug.c:(.text+0x4): undefined reference to `__st_r13_to_r15'
/global/freeware/Linux/2.X/arc_gnu_2020.09-elf32/bin/../lib/gcc/arc-elf32/10.2.0/../../../../arc-elf32/bin/ld: bug.c:(.text+0x32): undefined reference to `__ld_r13_to_r15_ret'
/global/freeware/Linux/2.X/arc_gnu_2020.09-elf32/bin/../lib/gcc/arc-elf32/10.2.0/../../../../arc-elf32/bin/ld: bug.c:(.text+0x32): undefined reference to `__ld_r13_to_r15_ret'
collect2: error: ld returned 1 exit status
$ ls bug
ls: cannot access bug: No such file or directory
$ arc-elf32-gcc -mcpu=em -Os bug.c -o bug
$ ls bug
bug
$ rm bug
$ arc-elf32-gcc -mcpu=em_mini bug.c -o bug
$ ls bug
bug
The text was updated successfully, but these errors were encountered:
Faced an issue with
-mcpu=em_mini
while testing #231. Without-Os
or with-mcpu=em
program builds fine.The text was updated successfully, but these errors were encountered: