EtchedPixels / CC6303

A C compiler for the 6800 series processors
Other
37 stars 7 forks source link

libc.a is 0 byte #17

Closed christopheKohler closed 2 years ago

christopheKohler commented 2 years ago

Hi I compiled under cygwin 64 and there is a problem with that file CC6303\libc\libc.a Size is 0 byte.

Testing compilation give a failure, saying libc.a is not good. While processing: /opt/cc68/lib/libc.a bad object file cc: /opt/cc68/bin/ld68 failed.

EtchedPixels commented 2 years ago

I'd expect that - it's a placeholder as nobody has put together a libc for it outside of the Fuzix one.

christopheKohler commented 2 years ago

ok. Just reporting that most of my compilations tries lead to an error "bad object file" relating libc.a. Even a nearly empty c file, with command cc68 -tmc10 foo.c -o foo lead to that error (I'm just following the doc).

EtchedPixels commented 2 years ago

I've tweaked it to create a blank libc.a. I don't remember why I originally made it a blank file instead, possibly some old tools didn't accept "ar rc libc.a" without anything in it.

christopheKohler commented 2 years ago

I can explain you my initial goal. I'm trying to use Cross-lib, so I compiled and installed cc6303. Fabrizzio do not have any problem with using your compiler (cygwin 32 bits) but I can not compile anything (cygwin 64 bits). I mentionned that the problem seem to be libc.a, but I have no use of it :) ... If you have anyidea so that I could have a successful cross-lib usage, then it would be great (zz88dk is also failing). Fabrizzio think this is the "64 bits" difference that make all my problems happen.

Fabrizio-Caruso commented 2 years ago

@christopheKohler @EtchedPixels Cross-Lib is not technically related to this issue. He is testing the mc10 target. @christopheKohler has reported that he has not succeded in compiling a simple helloworld example for the mc10 target. I can with no problem. My set is Windows 64-bit/Cygwin 32-bit

christopheKohler commented 2 years ago

Here is the log for CROSS-LIB. We can see the fail on libc.a.

$ ./xl build text mc10 Cross-Lib xl helper script Platform: cygwin GNU MAKE command: make

Project name : text Project type : example Number of threads : 8 Extra optimization : Compiler's options : run command : make mc10 ZSDCC_MAKEFILE_THREADS_OPTS='-j 8' ZSDCC_MAKEFILE_COMPILATION_OPTS= -f examples/text/Makefile.text

cc68 -tmc10 -Icross_lib -Icross_lib/sleep -Icross_lib/display -Icross_lib/display/graphics_mode -Icross_lib/display/alt_print -Icross_lib/include -Icross_lib/sound -Icross_lib/sound/cc65/atmos -Icross_lib/sound/cc65/c264 -Icross_lib/sound/cc65/pokey -Icross_lib/sound/cc65/sid -Icross_lib/sound/cc65/vic20 -Icross_lib/sound/cc65/gamate -Icross_lib/sound/cc65/creativision -Icross_lib/sound/cc65/pet -Icross_lib/sound/z88dk/bit_bang -Icross_lib/sound/z88dk/gb -Icross_lib/sound/z88dk/psg -Icross_lib/sound/lcc1802/comx -Icross_lib/sound/cmoc/mo5 -Icross_lib/sound/generic -Icross_lib/text -Icross_lib/input -Icross_lib/rand -Icross_lib/display/redefine_characters -Icross_lib/display/tiles -Iexamples/text/generated_assets -Iexamples/text \ -DMC10 -D_XL_NO_UDG \ -DFORCE_NO_CONIO_LIB \ -DXSize=32 \ -DYSize=16 \ -DMEMORY_MAPPED \ -D_XL_NO_COLOR \ -DTINY_GAME -DNO_SLEEP \ -DNO_INIT_GRAPHICS \ -DNO_PRINT -DNO_WAIT \ -DNO_INPUT -DNO_WALL \ -DDEFAULT_CLEAR_SCREEN \ cross_lib/display/display_macros.c cross_lib/input/input_macros.c cross_lib/text/text_macros.c examples/text/main.c \ cross_lib/rand/rand.c \ -o xchase examples/text/main.c(69): Warning: Parameter 'x' is never used examples/text/main.c(69): Warning: Parameter 'y' is never used While processing: /opt/cc68/lib/libc.a bad object file cc: /opt/cc68/bin/ld68 failed. make: *** [examples/text/Makefile.text:2013: mc10_no_print] Error 1

Fabrizio-Caruso commented 2 years ago

@EtchedPixels even this exampe won't compile (as reported to me by @christopheKohler ) with cc68 -tmc10 foo.c -o foo

int main(void)
{
        int hello;

        hello = 12;

        return 0;
}

and produce the error

While processing: /opt/cc68/lib/libc.a
bad object file
cc: /opt/cc68/bin/ld68 failed.
christopheKohler commented 2 years ago

Hi. Any fix have been done for cygwin 64bits compilation ?

EtchedPixels commented 2 years ago

I just changed it to build a real library with nothing in it. That seems to work for me with the GNU based ar tools

christopheKohler commented 2 years ago

ok, I'll give it a new try. Thanks.

EtchedPixels commented 2 years ago

Cool - I've been splitting the fuzix libc a bit to use for other targets so I'll probably import that at some point too

christopheKohler commented 2 years ago

I comfirm all is ok now. I compiled all and libc.a is 8 bytes long now (instead of 0) and all the above various compilations are going nicely now. Thanks.