Comments (5)
Ok, I've solved the previous error by copying the msvcrtd.lib in the 'C:/AGPX/Documenti/llvm-mos-sdk/build/commodore/64/lib' directory and renaming it in 'libmsvcrtd.a', but the 'examples/hello_putchar.c' doesn't works (bad code generation, looks like it output a 'brk'):
It 'crash' at location 0902 that have a BRK. What I miss? The hello.prg is 432 bytes long.
I have tried to generate the .s with:
..\llvm-mos\bin\clang.exe --config build/commodore/64.cfg -Os -o hello.s -Wl,--lto-emit-asm examples/hello_putchar.c
and I've obtained a HUGE .s file (246,444 bytes!) and the main is totally different from the one you showed:
.text
.file "ld-temp.o"
.section .text.main,"ax",@progbits
.globl main
.type main,@function
main:
.Lfunc_begin0:
lda mos8(__rc30)
pha
lda mos8(__rc31)
pha
lda mos8(__rc32)
pha
lda mos8(__rc33)
pha
lda #16
sta __main_sstk
lda #72
sta __main_sstk+2
lda #mos16lo(.str+1)
sta __main_sstk+1
ldy #mos16hi(.str+1)
.LBB0_1:
lda __main_sstk+1
sta mos8(__rc33)
sta mos8(__rc30)
sty mos8(__rc31)
sty mos8(__rc32)
lda __main_sstk+2
jsr __putchar
ldy #0
lda (mos8(__rc30)),y
sta __main_sstk+2
clc
lda __main_sstk
adc #-1
tax
clc
lda mos8(__rc33)
adc #1
sta __main_sstk+1
lda mos8(__rc32)
adc #0
tay
txa
stx __main_sstk
cpx #0
bne .LBB0_1
ldx #0
lda #0
sta mos8(__rc28)
pla
sta mos8(__rc33)
pla
sta mos8(__rc32)
pla
sta mos8(__rc31)
pla
sta mos8(__rc30)
lda mos8(__rc28)
rts
.Lfunc_end0:
... (tons of code) ...
I'm really confused. Please, support Windows platform.
from llvm-mos-sdk.
I had the same problems. Here's what I did to fix it for myself:
https://github.com/llvm-mos/llvm-mos-sdk/compare/main...Galfodo:windows-buildsystem-fixes?expand=1
from llvm-mos-sdk.
Just a heads up, @jackoalan is working on a more principled solution for Windows support in the SDK.
The root of the problem is that CMake defaults the target platform to the host platform (Windows), even when cross compiling. This doesn't cause any problems on Linux, but it does on Windows.
Should be a PR landing relatively soon with a CMake toolchain file that configures the MOS compilation environment with sensible defaults.
from llvm-mos-sdk.
Nice :) I was going to elaborate on my local changes, but I guess there will be no need. Having host and cross compilation targets in the same (cmake) project is probably not a good idea.
from llvm-mos-sdk.
The SDK refactor is finally merged and tested to work with a Visual Studio 2019 host toolchain. Follow the steps in the updated README (particularly the note for Windows users).
If using CMake for your application project, you may now use find_package(llvm-mos-sdk REQUIRED)
as described in the README. Alternatively, existing CMake projects can use the toolchain file via -DCMAKE_TOOLCHAIN_FILE=<sdk-install-prefix>/lib/cmake/llvm-mos-sdk/llvm-mos-toolchain.cmake -DLLVM_MOS_PLATFORM=<platform>
. This will ensure that Windows-specific compiler flags do not interfere.
from llvm-mos-sdk.
Related Issues (20)
- start address is indeterminate (because of zp data section)? HOT 1
- Write a simplified libretro runner
- Complete the libc using pieces from pdclibc HOT 1
- Investigate making `text.fixed` for libcalls
- Automatically generated linker scripts lack CMake integration HOT 1
- Verify negative tests fail for the "right" reasons
- Reading directly from memory HOT 2
- Create a test workflow that runs on PRs
- Benchmarks of programs compared to 80s compilers? HOT 3
- Implement libm min and max functions HOT 6
- Builder for Apple Silicon
- mos-sim crash HOT 2
- realloc returns memory overlapping with other memory block HOT 3
- Decide intermediate and long-term support for the 45GS02 CPU and relatives HOT 2
- Sanitize license compliance for dependent projects HOT 1
- Load addresses aren't relocated on CP/M-65 HOT 2
- Import @davidgiven's support for new targets HOT 1
- PCE mkcd relocations don't seem to work. HOT 4
- Bad .prg generation (code stripped by the optimizer?). HOT 7
- neo6502 (and maybe other platforms?) - crash in simple loop code HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llvm-mos-sdk.