hth313 / Calypsi-tool-chains

Overview of the Calypsi tool chain and open source support packages
16 stars 0 forks source link

"internal error: labeling failed" when using intrinsics functions (65816) #6

Closed ProxyPlayerHD closed 1 year ago

ProxyPlayerHD commented 1 year ago

the "full" error is:

internal error: labeling failed
Terminating due to errors
Temp\test.o: openBinaryFile: does not exist (No such file or directory)
Terminating due to errors

yes the second error is from the linker, even though my batch file checks if a program exists with an error using: IF %errorlevel% NEQ 0 GOTO ... but none of the Calypsi C programs seem to even use error levels, so it just tries to carry on like nothing happend.

and the test program i was trying to compile:

#include <intrinsics65816.h>

int main(){
    __wait_for_interrupt();
    return 0;
}

and the commands i used:

CC65816 --64bit-doubles --code-model large --data-model large -I Include -O2 --list-file Output\%inputN%.lst -o Temp\Test.o Test.c
LN65816 --hosted --cross-reference --rtattr cstartup=SBCv1 --verbose --output-format pgz -o Test.pgz Config\SBC_816.scm Config\cstartup.o Config\stdio_functions.o Temp\Test.o clib-lc-ld-double64.a

just say if any more information is needed.

ProxyPlayerHD commented 1 year ago

oops, nvm it was already fixed! i just had to update the utility.... which i remembered to do a few seconds after opening the issue

on a side note, it would be nice if the windows version would also come in a simple zip file so you can put the files wherever you want without running a program, instead of an installer that forces it into the programs folder.

hth313 commented 1 year ago

As you found out you need to use 3.6.10 which corrects the internal error with the intrinsic.

I am not sure about stopping on error on Windows (non zero exit code). This works (when using make) on both macOS and Linux, is Windows different in this regard?

It should be possible to copy the entire installation tree and use it from another location, also have multiple versions installed.

ProxyPlayerHD commented 1 year ago

I am not sure about stopping on error on Windows (non zero exit code). This works (when using make) on both macOS and Linux, is Windows different in this regard?

Honestly I'm not sure, i don't know how Linux based systems handle programs exiting with errors. I just know that when you either run the exit(EXIT_FAILURE) function or have main return a non-zero value in a C/C++ program, a batch/powershell program should be able to detect that.

It should be possible to copy the entire installation tree and use it from another location, also have multiple versions installed.

yes that's how i'm doing it right now, but it's still inconvenient to be forced to run the installer (as you can't easily extract the files from it), copy the files from the programs folder to where you want them, and then delete the ones in the programs folder. so being able to just download a zip file (or similar) that just contains everything the installer would normally extract, would be a very nice alternative to have.

hth313 commented 1 year ago

I have put a note on that there may be a problem with return codes on Windows, I will investigate it at some point.

Regarding shipping .zip files, I will ask around a bit, but my gut feeling is that we are supposed to use installers, they have benefits such as you can keep track of installed things. I like to keep the number of shipped installers down, at least for now as each image comes with a cost in time for me. When I get a better infrastructure in place to handle the release procedures and images, I may consider it.

ProxyPlayerHD commented 1 year ago

we are supposed to use installers

says who?

they have benefits such as you can keep track of installed things.

that is true i guess, but do people actually have that many versions installed that they need Windows to keep track them? also what happens when you update the program? does it uninstall the old version before installing the new one, or does it just overwrite the files? if the latter, Windows would then falsely report 2 versions being installed even though only files for 1 version exist.

I like to keep the number of shipped installers down, at least for now as each image comes with a cost in time for me.

Honestly i don't know how much effort creating an .msi installer takes. i thought it would be a mostly automated process using some Microsoft utility.

When I get a better infrastructure in place to handle the release procedures and images, I may consider it.

and even if you don't, at the very least please allow the user to change the installation directory in the installer. I know it should be possible because a lot of other programs using .msi installers do it as well.

hth313 commented 1 year ago

Well, I suppose the OS vendors like to have us use installers, but you raise an interesting topic, to question the need of it. I am going to look into it, providing .zip for Windows.

The path thing may be a setting that needs to be changed.

The effort in making the release is not creating the image itself, but the manual process I have to get it out so people can download it. I need to address that at some point as I like to provide more builds.