Issue 83512
Summary Embedded Java interpreter compilation with the target being x86_64-unknown-windows by clang crashes clang
Labels clang
Assignees
Reporter pantantrant
    In the ./Vitalix/build directory, I ran ./Build.sh, which is the following commands:

`tar -xf ../src/Java_6_Interpreter_in_C.tar.xz
tar -xf ../src/uefi-musl-master.tar.xz
clang -std=c89 -Iuefi-musl-master/include -IJava_6_Interpreter_in_C/jvm/include -IJava_6_Interpreter_in_C/jv
m/interpreter -IJava_6_Interpreter_in_C/jvm/include/interpreter -target x86_64-unknown-windows -mx32 -ffrees
tanding -fshort-wchar -c ../src/Vitalix.c -Oz -Wno-error -o Vitalix.dll
lld -flavor link -subsystem:efi_application -entry:UefiMain Vitalix.dll -out:BOOTX64.EFI
dd if=/dev/zero of=Vitalix.img bs=48M count=1 && printf "g\nn\n\n\n\nt\n1\nx\nn\nVitalix\nr\nw\n" | fdisk Vi
talix.img && mkfs.fat -F 32 Vitalix.img && mmd -i Vitalix.img ::/EFI && mmd -i Vitalix.img ::/EFI/BOOT && mc
opy -i Vitalix.img BOOTX64.EFI ::/EFI/BOOT`

and I got the following output:

`../src/Vitalix.c:580:29: warning: incompatible pointer types passing 'char *[81]' to parameter of type 'cons
t char ***' [-Wincompatible-pointer-types]
 jvm = prepareJVM(vit
alixdotjava, 1);
 ^~~
~~~~~~~~~~~
Java_6_Interpreter_in_C/jvm/include/interpretedjvm.h:13:40: note: passing argument to parameter 'sourceFiles
' here
InterpretedJVM prepareJVM(const char **sourceFiles[], int numFiles);
 ^
../src/Vitalix.c:895:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace,
preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang -std=c89 -Iuefi-musl-master/include -IJava_6_Interpreter_in_C/jvm/include -
IJava_6_Interpreter_in_C/jvm/interpreter -IJava_6_Interpreter_in_C/jvm/include/interpreter -target x86_64-un
known-windows -mx32 -ffreestanding -fshort-wchar -c ../src/Vitalix.c -Oz -Wno-error -o Vitalix.dll
1.      <eof> parser at end of file
2.      Code generation
#0 0x000073f4e781f503 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/libLLVM-16.so+0xe1f503)
#1 0x000073f4e781c7bf llvm::sys::RunSignalHandlers() (/usr/lib/libLLVM-16.so+0xe1c7bf)
#2 0x000073f4e7708849 (/usr/lib/libLLVM-16.so+0xd08849)
#3 0x000073f4e6240ec0 (/usr/lib/libc.so.6+0x40ec0)
#4 0x000073f4e75668b2 (/usr/lib/libLLVM-16.so+0xb668b2)
#5 0x00005dd7d1b14608
clang-16: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 16.0.6 (https://gitlab.archlinux.org/archlinux/packaging/packages/clang.git 9824753d9f33103154
5b424aa2311c9667c4b8aa)
Target: x86_64-unknown-windows-gnux32
Thread model: posix
InstalledDir: /usr/bin
clang-16: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-16: note: diagnostic msg: /tmp/Vitalix-0873bc.c
clang-16: note: diagnostic msg: /tmp/Vitalix-0873bc.sh
clang-16: note: diagnostic msg:

********************
lld: error: could not open 'Vitalix.dll': No such file or directory
1+0 records in
1+0 records out
50331648 bytes (50 MB, 48 MiB) copied, 0.0184006 s, 2.7 GB/s

Welcome to fdisk (util-linux 2.39.3).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS (MBR) disklabel with disk identifier 0x2f2ec18d.

Command (m for help): Created a new GPT disklabel (GUID: 839BA9C0-1480-4A1D-9EDF-2D729C14958C).

Command (m for help): Partition number (1-128, default 1): First sector (2048-98270, default 2048): Last sec
tor, +/-sectors or +/-size{K,M,G,T,P} (2048-98270, default 96255):
Created a new partition 1 of type 'Linux filesystem' and of size 46 MiB.

Command (m for help): Selected partition 1
Partition type or alias (type L to list all): Changed type of partition 'Linux filesystem' to 'EFI System'.

Command (m for help):
Expert command (m for help): Selected partition 1

New name:
Partition name changed from '' to 'Vitalix'.

Expert command (m for help):
Command (m for help): The partition table has been altered.
Syncing disks.

mkfs.fat 4.2 (2021-01-31)
BOOTX64.EFI: No such file or directory
`

Output of `uname -a`:

`Linux cachyos-x8664 6.7.6-2-cachyos #1 SMP PREEMPT_DYNAMIC Fri, 23 Feb 2024 18:24:09 +0000 x86_64 GNU/Linux`

[Vitalix.zip](https://github.com/llvm/llvm-project/files/14455149/Vitalix.zip)
[bugreportfiles.zip](https://github.com/llvm/llvm-project/files/14455235/bugreportfiles.zip)

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to