<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/83512>83512</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Embedded Java interpreter compilation with the target being x86_64-unknown-windows by clang crashes clang
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pantantrant
</td>
</tr>
</table>
<pre>
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)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0WEtz2zgS_jXwpYssEnzq4IOeHs_asSt2kt2TCwRACTEJqABQknPIb98CSL0cZ-OZzaQUWgIb3Y2v3yDGiKXk_BJlE5TNLkhnV0pfrom0RFpNpL2oFHu5vJZgVxxChBefhSWN2CG8qDrRMGBCc2qVfkF4CtegifRkE_cyNCu3ul0JugJhPI9aNY3aCrkEqtqWSGZQMkbRDEX7Zx5ZoiHY1RA6TkZThBd_kg15yp-upeV6rbnl-knIp2loiQ533_qdb2zreC2CtjNN0BJjuT6jpw2RSwiMZSiZ0XIEwfVreoQXQtKmYxyC65_ogPDi66Z9N2Uvu6c_vH4_99f7LNFLbmFX5k95GnTyWaqtDLZCMrU1ELS7BENQ15pzs0dJMgd_UJuV0jbY0pXDjZ7CNhg5pBDcfYPgi1QB11ppCBTs37Gm6Rk2DYOgbshGaWiEfIbAdJV5MZa3KBnzWjyR9boRlFihJARcWv2CkvEnXotbIuQpQwhUZ1EyntzdPf47T8P54rqXwRiIGiUzhBeMb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