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

Add sh config #4096

Merged
merged 3 commits into from
Oct 5, 2022
Merged

Add sh config #4096

merged 3 commits into from
Oct 5, 2022

Conversation

dkm
Copy link
Member

@dkm dkm commented Sep 28, 2022

Add 3 configs for sh targets:

  • old 4.9.4 unknown-elf (c/c++)
  • 9.5 linux (c/c++/fortran)
  • 12.2.0 linux (c/c++/fortran)

Old compiler were specificaly requested for Dreamcast hacking.

Not enabling D as it's not functional.

fixes #94

Signed-off-by: Marc Poulhiès dkm@kataplop.net

@dkm
Copy link
Member Author

dkm commented Sep 28, 2022

Compilers are nearly ready to be installed:

It seems the D compiler is not working correctly, so I'll probably disable it as I'm not sure many people want D for sh4... But who knows? :D Maybe @ibuclaw has an issue fix for this ?

/opt/compiler-explorer/sh/gcc-12.2.0/sh-multilib-linux-gnu/bin/sh-multilib-linux-gnu-gdc -c /tmp/test.d
d21: error: cannot find source code for runtime library file 'object.d'
d21: note: dmd might not be correctly installed. Run 'dmd -man' for installation instructions.
d21: note: config file: not found

Compiler is built using this ct-ng config. All other lang tests are OK locally:

sh CXX shg494 ASM----------------------- [OK]
sh CXX shg494 ASM+BINARY---------------- [OK]
sh C cshg494 ASM------------------------ [OK]
sh C cshg494 ASM+BINARY----------------- [OK]


#### Fake tests, they should FAIL or be SKIPPED, but never PASS
sh ADA shg494 ASM----------------------- [FAIL]
sh ADA shg494 ASM+BINARY---------------- [FAIL]
#### End of fake tests

sh D gdcsh950 ASM----------------------- [FAIL]
sh D gdcsh950 ASM+BINARY---------------- [FAIL]
sh FORTRAN fshg950 ASM------------------ [OK]
sh FORTRAN fshg950 ASM+BINARY----------- [SKIPPED (not supported)]
sh CXX shg950 ASM----------------------- [OK]
sh CXX shg950 ASM+BINARY---------------- [OK]
sh C cshg950 ASM------------------------ [OK]
sh C cshg950 ASM+BINARY----------------- [OK]


#### Fake tests, they should FAIL or be SKIPPED, but never PASS
sh ADA gdcsh950 ASM--------------------- [FAIL]
sh ADA gdcsh950 ASM+BINARY-------------- [FAIL]
#### End of fake tests

sh D gdcsh1220 ASM---------------------- [FAIL]
sh D gdcsh1220 ASM+BINARY--------------- [FAIL]
sh FORTRAN fshg1220 ASM----------------- [OK]
sh FORTRAN fshg1220 ASM+BINARY---------- [SKIPPED (not supported)]
sh CXX shg1220 ASM---------------------- [OK]
sh CXX shg1220 ASM+BINARY--------------- [OK]
sh C cshg1220 ASM----------------------- [OK]
sh C cshg1220 ASM+BINARY---------------- [OK]


#### Fake tests, they should FAIL or be SKIPPED, but never PASS
sh ADA gdcsh1220 ASM-------------------- [FAIL]
sh ADA gdcsh1220 ASM+BINARY------------- [FAIL]
#### End of fake tests

(sorry this comment was originally in the infra PR, better here).

Add 3 configs for sh targets:
- old 4.9.4 unknown-elf (c/c++)
- 9.5 linux (c/c++/fortran)
- 12.2.0 linux (c/c++/fortran)

Old compiler were specificaly requested for Dreamcast hacking.

Not enabling D as it's not functional.

fixes #94

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
@dkm
Copy link
Member Author

dkm commented Sep 29, 2022

I'll disable D for now

@dkm dkm marked this pull request as ready for review September 29, 2022 21:02
@ibuclaw
Copy link
Contributor

ibuclaw commented Sep 30, 2022

I'll disable D for now

Target comes without library support, but compiler still expects an object.d file to be present somewhere. What's the contents of test.d?

@dkm
Copy link
Member Author

dkm commented Sep 30, 2022

I'll disable D for now

Target comes without library support, but compiler still expects an object.d file to be present somewhere. What's the contents of test.d?

I don't know how to do any D, so I simply use the default program we have when creating a D compiler:

int square(int num) {
    return num * num;
}

@ibuclaw
Copy link
Contributor

ibuclaw commented Sep 30, 2022

int square(int num) {
return num * num;
}

As a workaround, you can just touch object.d in the top-level module search path, otherwise I don't see it unreasonable for the compiler to just stub the module when not found.

@dkm
Copy link
Member Author

dkm commented Oct 1, 2022

int square(int num) {
return num * num;
}

As a workaround, you can just touch object.d in the top-level module search path, otherwise I don't see it unreasonable for the compiler to just stub the module when not found.

Thanks @ibuclaw !

/tmp ❯❯❯ cat > test.d                                                                                                                                                                                        
int square(int num) { return num*num; }
/tmp ❯❯❯ systemctl suspend                                                                              
/tmp ❯❯❯ /opt/compiler-explorer/sh/gcc-12.2.0/sh-multilib-linux-gnu/bin/sh-multilib-linux-gnu-gdc -c test.d -o toto.o                                                                                        
d21: error: cannot find source code for runtime library file 'object.d'
d21: note: dmd might not be correctly installed. Run 'dmd -man' for installation instructions.
d21: note: config file: not found
/tmp ❯❯❯ touch object.d                                                                                                                                                                                        
/tmp ❯❯❯ /opt/compiler-explorer/sh/gcc-12.2.0/sh-multilib-linux-gnu/bin/sh-multilib-linux-gnu-gdc -c test.d -o toto.o
/tmp ❯❯❯ 

You mean like that?
We don't want to modify the compiler on our side. If such workaround makes sense, I could see if ct-ng would merge it. We could also do this during compilation, but maybe this would break other targets? What happens if we put an empty object.d for a target that doesn't need this kludge?

@ibuclaw
Copy link
Contributor

ibuclaw commented Oct 1, 2022

What happens if we put an empty object.d for a target that doesn't need this kludge?

Then that would likely take precedent over the "installed" version of object.d, causing the more complex examples to fail.

Touching the file in the installation path would be the safest thing to do, judging from the path for sh, it should be approximately located:

/opt/compiler-explorer/sh/gcc-12.2.0/sh-multilib-linux-gnu/lib/gcc/sh-multilib-linux-gnu/12/include/d/object.d

(I might have added one too many sh-multilib-linux-gnu's :-)

@dkm
Copy link
Member Author

dkm commented Oct 1, 2022

Ok, I'll see how to achieve that. And is it more a workaround or a fix? Is it expected because "target comes without lib support", or is it a bug in the compiler?
Thanks again for your help

@ibuclaw
Copy link
Contributor

ibuclaw commented Oct 1, 2022

Ok, I'll see how to achieve that. And is it more a workaround or a fix? Is it expected because "target comes without lib support", or is it a bug in the compiler?
Thanks again for your help

Many language features built into the compiler have dependencies on the runtime library, so it's not unreasonable for it to be complaining about not find the global object module.

Saying that, being more pay-as-you-go is something the compiler should be doing better at, and ignoring a missing object.d module is part of that goal. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107101

@dkm
Copy link
Member Author

dkm commented Oct 3, 2022

Ok, thanks a lot for helping with that @ibuclaw . I think I'll still keep it disabled for now as I'm not sure when I'll be able to find where to best stub this. If this is fixed in a future release I'll enable it! Also, not excluded that I give the stub another try and still re-enable D for already installed compilers.

etc/config/c++.amazon.properties Outdated Show resolved Hide resolved
@dkm
Copy link
Member Author

dkm commented Oct 5, 2022

Matching test for the compilers : https://gist.github.com/dkm/85576731222f940c85980ab68d2817c5

@dkm dkm merged commit 1b762eb into main Oct 5, 2022
@dkm dkm deleted the dkm/sh-support branch October 5, 2022 18:53
@mattgodbolt
Copy link
Member

This is slowly rolling out over the fleet now, ETA fully live ~30m

dkm added a commit that referenced this pull request Nov 11, 2022
Add C, C++, Fortran for sparc, sparc64, sparc-leon.

Add Ada and Go for sparc and sparc64.

Not adding D (same issue as
#4096 (comment))

Fixes #266

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
dkm added a commit that referenced this pull request Nov 12, 2022
Add C, C++, Fortran for sparc, sparc64, sparc-leon.

Add Ada and Go for sparc and sparc64.

Not adding D (same issue as
#4096 (comment))

Fixes #266

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
mattgodbolt pushed a commit that referenced this pull request Dec 20, 2022
Add C, C++, Fortran for sparc, sparc64, sparc-leon.

Add Ada and Go for sparc and sparc64.

Not adding D (same issue as
#4096 (comment))

Fixes #266

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sh support
4 participants