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

codegen assert failure on weak symbol use #1

Open
sleffler opened this issue Sep 5, 2024 · 2 comments
Open

codegen assert failure on weak symbol use #1

sleffler opened this issue Sep 5, 2024 · 2 comments

Comments

@sleffler
Copy link
Owner

sleffler commented Sep 5, 2024

Building OT code w/ --mabi=cheriot (i.e. NO baremetal) trips an assert. Attached are the artifacts to repro. Below is the stack trace+context from running the compiler under gdb. Looks to be a side-effect of the weak symbol aliasing previously reported (and thought to be fixed). CHERIoT-Platform@21a0d50 band-aid's the assert failure but resulting code may be incorrect (hitting assert failure when firmware is processed at boot by the loader).

sleffler@sleffler0:~/shodan/out/tmp/toolchain/build_toolchain_cheriot/bin$ more t                                            
#/usr/local/google/home/sleffler/shodan/cache/cheriot-tools/bin/clang-13 -cc1 -triple riscv32-unknown-unknown -emit-obj --mre
lax-relocations -disable-free -disable-llvm-verifier -discard-value-names -main-file-name dif_spi_host.c -mrelocation-model s
tatic -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -fno-verbose-asm -mconstructor-aliases -nostdsyst
eminc -target-cpu cheriot -target-feature +xcheri -target-feature -64bit -target-feature +relax -target-feature -save-restore
 -target-feature +xcheri-rvc -target-abi cheriot -msmall-data-limit 8 -debug-info-kind=constructor -dwarf-version=4 -debugger
-tuning=gdb -ffunction-sections -fdata-sections -fcoverage-compilation-dir=/usr/local/google/home/sleffler/shodan/hw/matcha/s
w/device/cheriot/soundstream -nostdsysteminc -nobuiltininc -D CHERIOT_NO_AMBIENT_MALLOC -D TEMPORAL_SAFETY -D SOFTWARE_REVOKE
R -D BANCHA -D CPU_TIMER_HZ=2000 -D TICK_RATE_HZ=10 -D SIMULATION -D CONFIG_MSHWM -D DEVICE_EXISTS_clint -D DEVICE_EXISTS_fla
sh_ctrl -D DEVICE_EXISTS_gpio -D DEVICE_EXISTS_i2s -D DEVICE_EXISTS_ml_top_core -D DEVICE_EXISTS_ml_top_dmem -D DEVICE_EXISTS
_otp -D DEVICE_EXISTS_pinmux -D DEVICE_EXISTS_plic -D DEVICE_EXISTS_shadow -D DEVICE_EXISTS_spi_host -D DEVICE_EXISTS_uart -D
 REVOKABLE_MEMORY_START=0x10000000 -D CHERIOT_INTERRUPT_NAMES=I2sRxWatermarkInterrupt=40, I2sTxWatermarkInterrupt=39, I2sTxEm                                                                                                                              
ptyInterrupt=41, MlTopFinishInterrupt=34, MlTopFaultInterrupt=35,  -Oz -Werror -std=c2x -fdebug-compilation-dir=/usr/local/go
ogle/home/sleffler/shodan/hw/matcha/sw/device/cheriot/soundstream -ferror-limit 19 -cheri-compartment=spi -fno-builtin -fno-s                                                                                                                              
igned-char -fwchar-type=short -fno-signed-wchar -fgnuc-version=4.2.1 -fcolor-diagnostics -vectorize-slp -fno-c++-static-destr
uctors -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c dif_spi_host-21ff75.c                                                                                                                                                                                  
r -cc1 -triple riscv32-unknown-unknown -emit-obj --mrelax-relocations -disable-free -disable-llvm-verifier -discard-value-nam
es -main-file-name dif_spi_host.c -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-                                                                                                                              
math -fno-verbose-asm -mconstructor-aliases -nostdsysteminc -target-cpu cheriot -target-feature +xcheri -target-feature -64bi
t -target-feature +relax -target-feature -save-restore -target-feature +xcheri-rvc -target-abi cheriot -msmall-data-limit 8 -                                                                                                                              
debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb -ffunction-sections -fdata-sections -fcoverage-compilation-
dir=/usr/local/google/home/sleffler/shodan/hw/matcha/sw/device/cheriot/soundstream -nostdsysteminc -nobuiltininc -D CHERIOT_N
O_AMBIENT_MALLOC -D TEMPORAL_SAFETY -D SOFTWARE_REVOKER -D BANCHA -D CPU_TIMER_HZ=2000 -D TICK_RATE_HZ=10 -D SIMULATION -D CO
NFIG_MSHWM -D DEVICE_EXISTS_clint -D DEVICE_EXISTS_flash_ctrl -D DEVICE_EXISTS_gpio -D DEVICE_EXISTS_i2s -D DEVICE_EXISTS_ml_
top_core -D DEVICE_EXISTS_ml_top_dmem -D DEVICE_EXISTS_otp -D DEVICE_EXISTS_pinmux -D DEVICE_EXISTS_plic -D DEVICE_EXISTS_sha
dow -D DEVICE_EXISTS_spi_host -D DEVICE_EXISTS_uart -D REVOKABLE_MEMORY_START=0x10000000 -D CHERIOT_INTERRUPT_NAMES="I2sRxWat
ermarkInterrupt=40, I2sTxWatermarkInterrupt=39, I2sTxEmptyInterrupt=41, MlTopFinishInterrupt=34, MlTopFaultInterrupt=35,"  -O
z -Werror -std=c2x -fdebug-compilation-dir=/usr/local/google/home/sleffler/shodan/hw/matcha/sw/device/cheriot/soundstream -fe
rror-limit 19 -cheri-compartment=spi -fno-builtin -fno-signed-char -fwchar-type=short -fno-signed-wchar -fgnuc-version=4.2.1 
-fcolor-diagnostics -vectorize-slp -fno-c++-static-destructors -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c /tmp/dif_spi_host
-21ff75.c                                                                                                                    
sleffler@sleffler0:~/shodan/out/tmp/toolchain/build_toolchain_cheriot/bin$ gdb clang-13                              
GNU gdb (Debian 13.2-1+build2) 13.2                                                                                          
Copyright (C) 2023 Free Software Foundation, Inc.                                                                            
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>                                        
This is free software: you are free to change and redistribute it.                                                           
There is NO WARRANTY, to the extent permitted by law.                                                                        
Type "show copying" and "show warranty" for details.                                                                         
This GDB was configured as "x86_64-linux-gnu".                                                                                                                                                                                                             
Type "show configuration" for configuration details.                                                                                                                                                                                                       
For bug reporting instructions, please see:                                                                                                                                                                                                                
<https://www.gnu.org/software/gdb/bugs/>.                                                                                    
Find the GDB manual and other documentation resources online at:                                                      
    <http://www.gnu.org/software/gdb/documentation/>.                                                                                                                                                                                                      
                                                                                                                                                                                                                                                           
For help, type "help".                                                                                                                                                                                                                                     
Type "apropos word" to search for commands related to "word"...                                                       
Reading symbols from clang-13...                                                                                             
(gdb) source t                                                                                                                                                                                                                                             
[Thread debugging using libthread_db enabled]                                                                                
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".                                           
clang-13: /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/llvm/include/llvm/Support/Casting.h:269: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = Function; Y = Constant; typename cast_retty<X, Y*>::re
t_type = Function*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.                          
                                                              
Program received signal SIGABRT, Aborted.                                                                                    
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0)                        
    at ./nptl/pthread_kill.c:44                                                                                              
44      ./nptl/pthread_kill.c: No such file or directory.                                                                    
(gdb) bt                                                                                                                     
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0)         
    at ./nptl/pthread_kill.c:44                                                                                              
#1  0x00007ffff7a7a14f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78     
#2  0x00007ffff7a2c102 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26                                                                                                                                                                      
#3  0x00007ffff7a154f2 in __GI_abort () at ./stdlib/abort.c:79                                                                                                                                                                                             
#4  0x00007ffff7a15415 in __assert_fail_base (fmt=0x7ffff7b8ae08 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",                
    assertion=assertion@entry=0x55555d6cb208 "isa<X>(Val) && \"cast<Ty>() argument of incompatible type!\"",         
    file=file@entry=0x55555d6cb190 "/usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/llvm/include/llvm/Support/Casting.h", line=line@entry=269, 
    function=function@entry=0x55555d6cd580 "typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = Function; Y = Constant; typename cast_retty<X, Y*>::ret_type = Function*]") at ./assert/assert.c:92
#5  0x00007ffff7a24d32 in __assert_fail (                                                                                    
    assertion=0x55555d6cb208 "isa<X>(Val) && \"cast<Ty>() argument of incompatible type!\"", 
    file=0x55555d6cb190 "/usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/llvm/include/llvm/Support/Casting.h", line=269, 
    function=0x55555d6cd580 "typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = Function; Y = Constant; typename cast_retty<X, Y*>::ret_type = Function*]") at ./assert/assert.c:101
#6  0x0000555556ba2d30 in llvm::cast<llvm::Function, llvm::Constant> (Val=0x5555613118e0)
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/llvm/include/llvm/Support/Casting.h:269 
#7  0x0000555558360fdd in clang::CodeGen::CodeGenModule::GetAddrOfFunction (this=0x55556108b0f0, GD=..., Ty=0x55556108d300, 
    ForVTable=false, DontDefer=false, IsForDefinition=clang::CodeGen::NotForDefinition)
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:3823
#8  0x0000555558767dc1 in EmitFunctionDeclPointer (CGF=..., GD=..., IsDirectCall=true)                                       
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGExpr.cpp:3483       
#9  0x00005555587778e5 in EmitDirectCallee (CGF=..., GD=...)                                                                 
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGExpr.cpp:5857       
#10 0x0000555558777b35 in clang::CodeGen::CodeGenFunction::EmitCallee (this=0x7fffffff62b0, E=0x55556136d918)                
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGExpr.cpp:5880       
#11 0x0000555558777ab1 in clang::CodeGen::CodeGenFunction::EmitCallee (this=0x7fffffff62b0, E=0x55556136db78)                
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGExpr.cpp:5874       
#12 0x000055555877762a in clang::CodeGen::CodeGenFunction::EmitCallExpr (this=0x7fffffff62b0, E=0x55556136db90,              
    ReturnValue=...)                                                                                                         
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGExpr.cpp:5822       
#13 0x00005555587b3545 in (anonymous namespace)::ScalarExprEmitter::VisitCallExpr (this=0x7fffffff4e50, E=0x55556136db90)                                                                                                                                  
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGExprScalar.cpp:595  
#14 0x00005555587d05d6 in clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit (this=0x7fffffff4e50, S=0x55556136db90)                                                                                  
--Type <RET> for more, q to quit, c to continue without paging--                                                             
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/build_toolchain_cheriot/tools/clang/include/clang/AST/StmtNodes.inc:857                                                                                                                    
#15 0x00005555587b2670 in (anonymous namespace)::ScalarExprEmitter::Visit (this=0x7fffffff4e50, E=0x55556136db90)            
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGExprScalar.cpp:418                                                                                                                                
#16 0x00005555587cd7f0 in clang::CodeGen::CodeGenFunction::EmitScalarExpr (this=0x7fffffff62b0, E=0x55556136db90,            
    IgnoreResultAssign=true)                                                                                                                                                                                                                               
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGExprScalar.cpp:5369 
#17 0x000055555875563c in clang::CodeGen::CodeGenFunction::EmitAnyExpr (this=0x7fffffff62b0, E=0x55556136db90, aggSlot=...,  
    ignoreResult=true)                                                                                                       
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGExpr.cpp:223        
#18 0x00005555587555ba in clang::CodeGen::CodeGenFunction::EmitIgnoredExpr (this=0x7fffffff62b0, E=0x55556136db90)           
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGExpr.cpp:208        
#19 0x0000555558288177 in clang::CodeGen::CodeGenFunction::EmitStmt (this=0x7fffffff62b0, S=0x55556136db90, Attrs=...)       
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:120        
#20 0x000055555828ed7c in clang::CodeGen::CodeGenFunction::EmitCaseStmt (this=0x7fffffff62b0, S=..., Attrs=...)              
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:1565       
#21 0x0000555558288f58 in clang::CodeGen::CodeGenFunction::EmitSimpleStmt (this=0x7fffffff62b0, S=0x55556136d8f0, Attrs=...) 
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:427
#22 0x0000555558287fa4 in clang::CodeGen::CodeGenFunction::EmitStmt (this=0x7fffffff62b0, S=0x55556136d8f0, Attrs=...)       
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:57         
#23 0x000055555828938f in clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope (this=0x7fffffff62b0, S=..., 
    GetLast=false, AggSlot=...)                                                                                              
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:496        
#24 0x0000555558289056 in clang::CodeGen::CodeGenFunction::EmitCompoundStmt (this=0x7fffffff62b0, S=..., GetLast=false,      
    AggSlot=...)                                                                                                                                                                                                                                           
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:447                                                                                                                                      
#25 0x0000555558288e32 in clang::CodeGen::CodeGenFunction::EmitSimpleStmt (this=0x7fffffff62b0, S=0x55556136df88, Attrs=...)                                                                                                                               
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:403        
#26 0x0000555558287fa4 in clang::CodeGen::CodeGenFunction::EmitStmt (this=0x7fffffff62b0, S=0x55556136df88, Attrs=...)
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:57                                                                                                                                       
#27 0x000055555828fe83 in clang::CodeGen::CodeGenFunction::EmitSwitchStmt (this=0x7fffffff62b0, S=...)                                                                                                                                                     
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:1982                                                                                                                                     
#28 0x0000555558288315 in clang::CodeGen::CodeGenFunction::EmitStmt (this=0x7fffffff62b0, S=0x55556136d878, Attrs=...)
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:154        
#29 0x000055555828938f in clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope (this=0x7fffffff62b0, S=...,                                                                                                                                       
    GetLast=false, AggSlot=...)                                                                                              
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:496
#30 0x0000555558289056 in clang::CodeGen::CodeGenFunction::EmitCompoundStmt (this=0x7fffffff62b0, S=..., GetLast=false,                                                                                                                                    
--Type <RET> for more, q to quit, c to continue without paging--                                                             
    AggSlot=...)                                              
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:447        
#31 0x0000555558288e32 in clang::CodeGen::CodeGenFunction::EmitSimpleStmt (this=0x7fffffff62b0, S=0x55556136dfc0, Attrs=...)
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:403        
#32 0x0000555558287fa4 in clang::CodeGen::CodeGenFunction::EmitStmt (this=0x7fffffff62b0, S=0x55556136dfc0, Attrs=...)       
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:57         
#33 0x000055555828bd42 in clang::CodeGen::CodeGenFunction::EmitForStmt (this=0x7fffffff62b0, S=..., ForAttrs=...)
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:1046       
#34 0x00005555582882cf in clang::CodeGen::CodeGenFunction::EmitStmt (this=0x7fffffff62b0, S=0x55556136dfe0, Attrs=...)
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:150                                                                                                                                      
#35 0x000055555828938f in clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope (this=0x7fffffff62b0, S=...,                                                                                                                                       
    GetLast=false, AggSlot=...)                                                                                              
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CGStmt.cpp:496
#36 0x0000555558338759 in clang::CodeGen::CodeGenFunction::EmitFunctionBody (this=0x7fffffff62b0, Body=0x55556136e060)                                                                                                                                     
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp:1256                                                                                    
#37 0x000055555833938c in clang::CodeGen::CodeGenFunction::GenerateCode (this=0x7fffffff62b0, GD=..., Fn=0x55556134dd28,     
    FnInfo=...)                                                                                                              
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp:1430                        
#38 0x000055555836576d in clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition (this=0x55556108b0f0, GD=...,                                                                                                                                        
    GV=0x55556134dd28)                                                                                                       
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:5016
#39 0x000055555835e6a0 in clang::CodeGen::CodeGenModule::EmitGlobalDefinition (this=0x55556108b0f0, GD=..., GV=0x0)         
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:3332
#40 0x000055555835d728 in clang::CodeGen::CodeGenModule::EmitGlobal (this=0x55556108b0f0, GD=...)
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:3084
#41 0x000055555836970a in clang::CodeGen::CodeGenModule::EmitTopLevelDecl (this=0x55556108b0f0, D=0x55556136b918)            
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:5853
#42 0x00005555594ea130 in (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl (this=0x555561089dc0, DG=...)         
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/ModuleBuilder.cpp:170 
#43 0x00005555594e3506 in clang::BackendConsumer::HandleTopLevelDecl (this=0x555561026b50, D=...)                            
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:215 
#44 0x000055555b0e0fab in clang::ParseAST (S=..., PrintStats=false, SkipFunctionBodies=false)                                
--Type <RET> for more, q to quit, c to continue without paging--                                                             
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/Parse/ParseAST.cpp:162        
#45 0x0000555558b5c1bf in clang::ASTFrontendAction::ExecuteAction (this=0x555561064290)                                      
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/Frontend/FrontendAction.cpp:1058                                                                                                                            
#46 0x00005555594e0d21 in clang::CodeGenAction::ExecuteAction (this=0x555561064290)                                          
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1070                                                                                                                              
#47 0x0000555558b5bb15 in clang::FrontendAction::Execute (this=0x555561064290)                                               
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/Frontend/FrontendAction.cpp:951                                                                                                                             
#48 0x0000555558aa0c01 in clang::CompilerInstance::ExecuteAction (this=0x55556105fea0, Act=...)                              
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/Frontend/CompilerInstance.cpp:974                                                                                                                           
#49 0x0000555558ce6612 in clang::ExecuteCompilerInvocation (Clang=0x55556105fea0)                                            
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:278                                                                                                              
#50 0x00005555566bfd12 in cc1_main (Argv=...,                                                                                
    Argv0=0x7fffffffccf3 "/usr/local/google/home/sleffler/shodan/out/tmp/toolchain/build_toolchain_cheriot/bin/clang-13",    
    MainAddr=0x5555566b37da <GetExecutablePath[abi:cxx11](char const*, bool)>)                                               
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/tools/driver/cc1_main.cpp:247     
#51 0x00005555566b4f14 in ExecuteCC1Tool (ArgV=...)                                                                          
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/tools/driver/driver.cpp:338       
#52 0x00005555566b5585 in main (Argc=108, Argv=0x7fffffffc4a8)                                                               
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/tools/driver/driver.cpp:412       
(gdb) up                                                                                                                     
#1  0x00007ffff7a7a14f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78            
78      in ./nptl/pthread_kill.c                                                                                             
(gdb)                                                                                                                        
#2  0x00007ffff7a2c102 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26                                        
26      ../sysdeps/posix/raise.c: No such file or directory.                                                                 
(gdb)                                                                                                                        
#3  0x00007ffff7a154f2 in __GI_abort () at ./stdlib/abort.c:79                                                               
79      ./stdlib/abort.c: No such file or directory.                                                                         
(gdb)                                                                                                                        
#4  0x00007ffff7a15415 in __assert_fail_base (fmt=0x7ffff7b8ae08 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55555d6cb208 "isa<X>(Val) && \"cast<Ty>() argument of incompatible type!\"",                                     
    file=file@entry=0x55555d6cb190 "/usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/llvm/include/llvm/Support/Casting.h", line=line@entry=269,                                                                               
    function=function@entry=0x55555d6cd580 "typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = Function; Y = Constant; typename cast_retty<X, Y*>::ret_type = Function*]") at ./assert/assert.c:92                                        
92      ./assert/assert.c: No such file or directory.                                                                        
(gdb)                                                                                                                        
#5  0x00007ffff7a24d32 in __assert_fail (assertion=0x55555d6cb208 "isa<X>(Val) && \"cast<Ty>() argument of incompatible type!\"",                                                                                                                          
    file=0x55555d6cb190 "/usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/llvm/include/llvm/Support/Casting.h", line=269,                                                                                                     
    function=0x55555d6cd580 "typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = Function; Y = Constant; typename cast_retty<X, Y*>::ret_type = Function*]") at ./assert/assert.c:101                                                      
101     in ./assert/assert.c                                                                                                 
(gdb)                                                                                                                        
#6  0x0000555556ba2d30 in llvm::cast<llvm::Function, llvm::Constant> (Val=0x5555613118e0) at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/llvm/include/llvm/Support/Casting.h:269                                         
269       assert(isa<X>(Val) && "cast<Ty>() argument of incompatible type!");                                                
(gdb) l                                                                                                                      
264                               typename simplify_type<Y>::SimpleType>::doit(Val);                                                                                                                                                                       
265     }                                                                                                                    
266                                                           
267     template <class X, class Y>                                                                                          
268     inline typename cast_retty<X, Y *>::ret_type cast(Y *Val) {                                                         
269       assert(isa<X>(Val) && "cast<Ty>() argument of incompatible type!");                                                
270       return cast_convert_val<X, Y*,                                                                                     
271                               typename simplify_type<Y*>::SimpleType>::doit(Val);                                        
272     }                                                                                                                    
273                                                                                                                          
(gdb) up                                                                                                                     
#7  0x0000555558360fdd in clang::CodeGen::CodeGenModule::GetAddrOfFunction (this=0x55556108b0f0, GD=..., Ty=0x55556108d300, ForVTable=false, DontDefer=false, IsForDefinition=clang::CodeGen::NotForDefinition)                                            
    at /usr/local/google/home/sleffler/shodan/out/tmp/toolchain/cheriot-llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:3823                                                                                                                              
3823              ->addFnAttr("cheri-compartment", getLangOpts().CheriCompartmentName);                                      
(gdb) l                                                                                                                      
3818        if (CC == CC_CHERICCallback)                                                                                                                                                                                                                   
3819          isExportedFunction = true;                                                                                                                                                                                                                   
3820        else if (!getLangOpts().CheriCompartmentName.empty() &&                                                          
3821                 (CC != CC_CHERILibCall))                                                                                
3822          cast<llvm::Function>(F->stripPointerCasts())                                                                                                                                                                                                 
3823              ->addFnAttr("cheri-compartment", getLangOpts().CheriCompartmentName);                                                                                                                                                                    
3824      }                                                                                                                  
3825                                                                                                                         
3826      if (FD->hasAttr<InterruptStateAttr>())                                                                             
3827        cast<llvm::Function>(F->stripPointerCasts())                                                                     
(gdb)
@sleffler
Copy link
Owner Author

sleffler commented Sep 5, 2024

dif_spi_host.TGZ

compiler-generated artifacts

@sleffler
Copy link
Owner Author

sleffler commented Sep 5, 2024

Re: weak symbol comment; that's based on my removing the same weak symbols cited in CHERIoT-Platform#30.

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

No branches or pull requests

1 participant