Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mips64el-linux-gnuabi64 #106

Closed
LinuxUserGD opened this issue Aug 9, 2022 · 1 comment · Fixed by #185
Closed

mips64el-linux-gnuabi64 #106

LinuxUserGD opened this issue Aug 9, 2022 · 1 comment · Fixed by #185

Comments

@LinuxUserGD
Copy link
Contributor

Host system: x86_64-gentoo-linux-musl

-- Found ccache /usr/bin/ccache
-- Configuring zig version 0.10.0-dev.2931+bdf3fa12f
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/zig-bootstrap/out/build-zig-host
[  1%] Built target opt_c_util
[  5%] Built target zigcpp
[ 86%] Built target embedded_softfloat
[ 98%] Built target zigstage1
[ 99%] Built target zig0
[100%] Built target zig
Install the project...
-- Install configuration: "Release"
-- Installing: /home/user/zig-bootstrap/out/host/bin/zig
-- Set runtime path of "/home/user/zig-bootstrap/out/host/bin/zig" to ""
-- Installing: /home/user/zig-bootstrap/out/host/lib
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is Clang 14.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /home/user/zig-bootstrap/out/host/bin/zig
-- Check for working C compiler: /home/user/zig-bootstrap/out/host/bin/zig - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/home/user/zig-bootstrap/out/host/bin/zig"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/user/zig-bootstrap/out/build-zlib-mips64el-linux-gnuabi64-baseline/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_bcf9e/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_bcf9e.dir/build.make CMakeFiles/cmTC_bcf9e.dir/build
    gmake[1]: Entering directory '/home/user/zig-bootstrap/out/build-zlib-mips64el-linux-gnuabi64-baseline/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_bcf9e.dir/testCCompiler.c.o
    /home/user/zig-bootstrap/out/host/bin/zig  cc -fno-sanitize=all -s -target mips64el-linux-gnuabi64 -mcpu=baseline    -MD -MT CMakeFiles/cmTC_bcf9e.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_bcf9e.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_bcf9e.dir/testCCompiler.c.o -c /home/user/zig-bootstrap/out/build-zlib-mips64el-linux-gnuabi64-baseline/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_bcf9e
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bcf9e.dir/link.txt --verbose=1
    /home/user/zig-bootstrap/out/host/bin/zig  cc -fno-sanitize=all -s -target mips64el-linux-gnuabi64 -mcpu=baseline -rdynamic CMakeFiles/cmTC_bcf9e.dir/testCCompiler.c.o -o cmTC_bcf9e
    /home/user/zig-bootstrap/out/host/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c:29:18: error: unknown type name '__time64_t'
    in_time_t_range (__time64_t t)
                     ^
    1 error generated.
    gmake[1]: *** [CMakeFiles/cmTC_bcf9e.dir/build.make:100: cmTC_bcf9e] Error 1
    gmake[1]: Leaving directory '/home/user/zig-bootstrap/out/build-zlib-mips64el-linux-gnuabi64-baseline/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:127: cmTC_bcf9e/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


-- Configuring incomplete, errors occurred!
See also "/home/user/zig-bootstrap/out/build-zlib-mips64el-linux-gnuabi64-baseline/CMakeFiles/CMakeOutput.log".
See also "/home/user/zig-bootstrap/out/build-zlib-mips64el-linux-gnuabi64-baseline/CMakeFiles/CMakeError.log".
@xdqi
Copy link

xdqi commented Aug 9, 2024

Compiles with the current version on x86_64 Ubuntu 22.04

But compiled zig doesn't work under either qemu-user or real mips64el machine.

$ /lib/mips64el-linux-gnuabi64/libc.so.6
GNU C Library (Debian GLIBC 2.28-13.lnd.4) stable release version 2.28.
Copyright (C) 2018 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.
Compiled by GNU CC version 8.3.0.
libc ABIs: MIPS_PLT UNIQUE MIPS_O32_FP64 ABSOLUTE MIPS_XHASH
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.
$ ldd ~/zig-mips64el-linux-gnuabi64.2.17-baseline/zig
	linux-vdso.so.1 (0x00007ffffd8ac000)
	libm.so.6 => /lib/mips64el-linux-gnuabi64/libm.so.6 (0x00007ffff7cd4000)
	libpthread.so.0 => /lib/mips64el-linux-gnuabi64/libpthread.so.0 (0x00007ffff7c9c000)
	libc.so.6 => /lib/mips64el-linux-gnuabi64/libc.so.6 (0x00007ffff7ac0000)
	libdl.so.2 => /lib/mips64el-linux-gnuabi64/libdl.so.2 (0x00007ffff7aac000)
	/lib64/ld.so.1 (0x00000000fffc0000)
$ ~/zig-mips64el-linux-gnuabi64.2.17-baseline/zig
Segmentation fault
$ gdb -q ~/zig-mips64el-linux-gnuabi64.2.17-baseline/zig
rReading symbols from /home/xd/zig-mips64el-linux-gnuabi64.2.17-baseline/zig...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/xd/zig-mips64el-linux-gnuabi64.2.17-baseline/zig
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/mips64el-linux-gnuabi64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0000000000d4f9c0 in ?? ()
(gdb) bt
#0  0x0000000000d4f9c0 in ?? ()
#1  0x000000000c353e78 in tzname ()
Backtrace stopped: frame did not save the PC
(gdb) q
A debugging session is active.

	Inferior 1 [process 4381] will be killed.

Quit anyway? (y or n) y
$  uname -a
Linux xd 5.15.0-113-generic #123-Ubuntu SMP Mon Jun 10 08:16:17 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
$ qemu-mips64el-static --version
qemu-mips64el version 9.0.2 (Debian 1:9.0.2+ds-2)
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers
$ sudo docker run --rm -it --platform=linux/mips64le -v $PWD:/code debian bash
root@5f49b752814c:/# /lib/mips64el-linux-gnuabi64/libc.so.6
GNU C Library (Debian GLIBC 2.36-9+deb12u7) stable release version 2.36.
Copyright (C) 2022 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.
Compiled by GNU CC version 12.2.0.
libc ABIs: MIPS_PLT UNIQUE MIPS_O32_FP64 ABSOLUTE MIPS_XHASH
Minimum supported kernel: 3.2.0
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.
root@5f49b752814c:/# /code/zig-mips64el-linux-gnuabi64.2.17-baseline/zig
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault (core dumped)
root@5f49b752814c:/# QEMU_STRACE=1 /code/zig-mips64el-linux-gnuabi64.2.17-baseline/zig
14 brk(NULL) = 0x000000000c354000
14 mmap(NULL,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0) = 0x00007fe08c531000
14 access("/etc/ld.so.preload",R_OK) = -1 errno=2 (No such file or directory)
14 openat(AT_FDCWD,"/etc/ld.so.cache",O_RDONLY|O_CLOEXEC) = 3
14 statx(3,"",AT_EMPTY_PATH|AT_NO_AUTOMOUNT|AT_STATX_SYNC_AS_STAT,STATX_BASIC_STATS,0x00007fe08cd75400) = 0
14 mmap(NULL,4946,PROT_READ,MAP_PRIVATE,3,0) = 0x00007fe08c52f000
14 close(3) = 0
14 openat(AT_FDCWD,"/lib/mips64el-linux-gnuabi64/libm.so.6",O_RDONLY|O_CLOEXEC) = 3
14 read(3,0x8cd75728,832) = 832
14 statx(3,"",AT_EMPTY_PATH|AT_NO_AUTOMOUNT|AT_STATX_SYNC_AS_STAT,STATX_BASIC_STATS,0x00007fe08cd75360) = 0
14 mmap(NULL,854336,PROT_NONE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0) = 0x00007fe08c45e000
14 mmap(0x00007fe08c460000,788800,PROT_EXEC|PROT_READ,MAP_PRIVATE|MAP_DENYWRITE|MAP_FIXED,3,0) = 0x00007fe08c460000
14 munmap(0x00007fe08c45e000,8192) = 0
14 munmap(0x00007fe08c521000,55616) = 0
14 mprotect(0x00007fe08c509000,90112,PROT_NONE) = 0
14 mmap(0x00007fe08c51f000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_DENYWRITE|MAP_FIXED,3,0xaf000) = 0x00007fe08c51f000
14 mprotect(0x00007fe08cd76000,4096,PROT_EXEC|PROT_READ|PROT_WRITE|PROT_GROWSDOWN) = 0
14 close(3) = 0
14 openat(AT_FDCWD,"/lib/mips64el-linux-gnuabi64/libpthread.so.0",O_RDONLY|O_CLOEXEC) = 3
14 read(3,0x8cd75708,832) = 832
14 statx(3,"",AT_EMPTY_PATH|AT_NO_AUTOMOUNT|AT_STATX_SYNC_AS_STAT,STATX_BASIC_STATS,0x00007fe08cd75340) = 0
14 mmap(NULL,196736,PROT_NONE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0) = 0x00007fe08c42f000
14 mmap(0x00007fe08c430000,131200,PROT_EXEC|PROT_READ,MAP_PRIVATE|MAP_DENYWRITE|MAP_FIXED,3,0) = 0x00007fe08c430000
14 munmap(0x00007fe08c42f000,4096) = 0
14 munmap(0x00007fe08c451000,57472) = 0
14 mprotect(0x00007fe08c431000,122880,PROT_NONE) = 0
14 mmap(0x00007fe08c44f000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_DENYWRITE|MAP_FIXED,3,0xf000) = 0x00007fe08c44f000
14 close(3) = 0
14 openat(AT_FDCWD,"/lib/mips64el-linux-gnuabi64/libc.so.6",O_RDONLY|O_CLOEXEC) = 3
14 read(3,0x8cd756e8,832) = 832
14 statx(3,"",AT_EMPTY_PATH|AT_NO_AUTOMOUNT|AT_STATX_SYNC_AS_STAT,STATX_BASIC_STATS,0x00007fe08cd75320) = 0
14 mmap(NULL,2234320,PROT_NONE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0) = 0x00007fe08c20e000
14 mmap(0x00007fe08c210000,2168784,PROT_EXEC|PROT_READ,MAP_PRIVATE|MAP_DENYWRITE|MAP_FIXED,3,0) = 0x00007fe08c210000
14 munmap(0x00007fe08c20e000,8192) = 0
14 munmap(0x00007fe08c422000,55248) = 0
14 mprotect(0x00007fe08c3fa000,65536,PROT_NONE) = 0
14 mmap(0x00007fe08c40a000,45056,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_DENYWRITE|MAP_FIXED,3,0x1ea000) = 0x00007fe08c40a000
14 mmap(0x00007fe08c415000,51152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,-1,0) = 0x00007fe08c415000
14 close(3) = 0
14 openat(AT_FDCWD,"/lib/mips64el-linux-gnuabi64/libdl.so.2",O_RDONLY|O_CLOEXEC) = 3
14 read(3,0x8cd756c8,832) = 832
14 statx(3,"",AT_EMPTY_PATH|AT_NO_AUTOMOUNT|AT_STATX_SYNC_AS_STAT,STATX_BASIC_STATS,0x00007fe08cd75300) = 0
14 mmap(NULL,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0) = 0x00007fe08c52d000
14 mmap(NULL,196736,PROT_NONE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0) = 0x00007fe08c1df000
14 mmap(0x00007fe08c1e0000,131200,PROT_EXEC|PROT_READ,MAP_PRIVATE|MAP_DENYWRITE|MAP_FIXED,3,0) = 0x00007fe08c1e0000
14 munmap(0x00007fe08c1df000,4096) = 0
14 munmap(0x00007fe08c201000,57472) = 0
14 mprotect(0x00007fe08c1e1000,122880,PROT_NONE) = 0
14 mmap(0x00007fe08c1ff000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_DENYWRITE|MAP_FIXED,3,0xf000) = 0x00007fe08c1ff000
14 close(3) = 0
14 mmap(NULL,12288,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0) = 0x00007fe08c52a000
14 set_thread_area(0x00007fe08c531780) = 0
14 set_tid_address(0x7fe08c52a0f0) = 14
14 set_robust_list(0x7fe08c52a100,24) = -1 errno=89 (Function not implemented)
14 Unknown syscall 5327
14 mprotect(0x00007fe08c40a000,24576,PROT_READ) = 0
14 mprotect(0x00007fe08c1ff000,4096,PROT_READ) = 0
14 mprotect(0x00007fe08c44f000,4096,PROT_READ) = 0
14 mprotect(0x00007fe08c51f000,4096,PROT_READ) = 0
14 mprotect(0x000000000bce4000,4427776,PROT_READ) = 0
14 mprotect(0x00007fe08c573000,4096,PROT_READ) = 0
14 prlimit64(0,RLIMIT_STACK,NULL,0x00007fe08cd76218) = 0 ({rlim_cur=8388608,rlim_max=-1})
14 munmap(0x00007fe08c52f000,4946) = 0
14 gettid() = 14
14 gettid() = 14
14 gettid() = 14
14 rt_sigprocmask(UNKNOWN,0x000000000c2c3f90,0x0000000001000000,16) = -1 errno=22 (Invalid argument)
14 getrandom(0x7fe08c419e88,8,1) = 8
14 brk(0x000000000c374e70) = 0x000000000c374e70
14 brk(0x000000000c375000) = 0x000000000c375000
14 unlink("debug-counter") = -1 errno=2 (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=1, si_addr=NULL} ---
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault (core dumped)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants