2558 Commits
Author SHA1 Message Date
Mats Jun Larsen 4d4987e25b Move noscript compile handler into own controller file
Continuation of my previous work on the http endpoints. This leaves the
old noscriptHandler to only serve the HTML pages.
2025-02-08 15:19:33 +09:00
Matt Godbolt 14b4af3cfa Fix up imports 2025-02-06 11:10:34 -06:00
Marc Poulhiès 80c864ffd1 Hardcode that gm2 and ga68 are GCC-dump enabled
Should be autodetected but both drivers are not behaving like gcc
driver.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2025-02-05 17:23:58 +01:00
narpfel 2e69144b27 Add quickfixes for missing imports and feature flags (#7357) 2025-02-03 04:13:08 +00:00
Mats Jun Larsen 5eea63328f Migrate to Biome for linting and formatting (#7033) 2025-02-02 17:54:31 +00:00
Mats Jun Larsen 96e1db8509 Introduce jsonOnly middleware for requiring JSON content type 2025-02-01 02:05:03 +09:00
Marc Poulhiès d6d124307f fix ga68 compiler setup
refs https://github.com/compiler-explorer/compiler-explorer/issues/7258

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2025-01-31 09:07:00 +01:00
Marc Poulhiès ce11ca3808 Add new language: Algol68 and corresponding GCC frontend (#7346)
refs https://github.com/compiler-explorer/compiler-explorer/issues/7258

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2025-01-31 08:37:48 +01:00
narpfel b3cc0c61e7 Parse Rust error message locations with multiple leading spaces (#7344)
Rust error message locations (` --> <source>:<line>:<col>`) can have
more than one leading space, e. g. when the source code snippet that is
shown has line numbers greater than ten.

In this example (https://godbolt.org/z/9W8xPv36c), the error message is
not be recognised as an error and there are no red squigglies in the
editor pane.
2025-01-30 15:57:50 -06:00
narpfel f060417c34 Strip hyperlink escape sequences from editor pane diagnostics hover widget (#7342)
When passing `-fdiagnostics-urls=always`/`-Z terminal-urls=yes`, the
hyperlink escape sequence was not stripped from the mouse hover widget
in the editor pane.

Link: https://godbolt.org/z/3cP8jj8jc

Hover over the empty braces in the C++ editor or the `i32` in the Rust
editor:

Before:
```
warning: no return statement in function returning non-void []8;;https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wno-return-type-Wreturn-type]8;;]x86-64 gcc 14.2 #1
error[]8;;https://doc.rust-lang.org/error_codes/E0308.htmlE0308]8;;]: mismatched typesrustc nightly #2
```

Now:
```
warning: no return statement in function returning non-void [-Wreturn-type]x86-64 gcc 14.2 #1
error[E0308]: mismatched typesrustc nightly #2
```
2025-01-30 14:14:22 -06:00
Matt Godbolt cd29f86d24 Prevent exception if compiler didn't generate (#7334)
Stops sentry errors, gives a slightly less awful error to the user.
Closes #1814

Tested locally.
2025-01-29 15:06:43 -06:00
Marc Auberer 2d4a8d59fa Fix function define regex in pass dump parser (#7330)
Function in LLVM IR can also contain `-` characters without being
enquoted.
2025-01-29 11:30:16 -06:00
Mats Jun Larsen bcd6394435 Ensure that content type for formatting requests is JSON (#7327)
Ideally I'd add a middleware or something else that requires JSON, but I
suppose this is fine for now.

cc @dkm
2025-01-29 10:46:56 -06:00
Waqar Ahmed 54ea096e1a odin: require main function (#7314)
In optimized build, odin inlines the world and even ends up inlining the
user visible `main` function into the entry point main. The result is
empty asm output which is confusing. Thus, @require main so that the
compiler doesn't inline user visible main function

 #7210
2025-01-29 10:41:03 -06:00
Matt Godbolt ed825b8aa2 Some tidying up of the asm parser code (#7329)
- use `Set` and `Map`
- reflow comments
- remove redundant `!!`
- rephrase iterative "follow the chain of weak symbols" to be recursive,
removing artificial limit.
2025-01-29 10:29:06 -06:00
Waqar Ahmed 650e706c4d Unset context.prevLabel when a label gets filtered (#7315)
Otherwise subsequent unused label's directives end up being included in
the processed asm even though the label itself got filtered
2025-01-29 08:40:07 -06:00
Matt Godbolt f1e930b7fc Decommision the "AWS" magic compiler name (#7321)
Nothing was using it, we're using other methods these days to discover
remote compilers (and have been for years), and it was broken (see
#1790).

Also cleans up some config (moving it from aws to ceProps; though it was
unused, default used only), and also some workarounds for remote
compilers that refer back to the MS compiler era (#1768).

This leaves the ability in `aws.ts` to fetch instances in case we ever
need the functionality, as this is tested and still works.

Closes #1790
2025-01-29 08:36:01 -06:00
kevinjeon-g 44920dd00d Fix .smali class regex in Dex2OatCompiler (#7319) 2025-01-29 09:36:11 +00:00
Matt Godbolt 3b507a6db3 Handle ARM's .set usage (#7322)
Treats `.set` as an "alias" for the set of labels referred to, and
doesn't filter alias-creating `.set` in used paths even if directive
filtering is on. Only works for `.set <something>, .` with an optional
`+ 0`.

Also changes a silly loop that was looping N times doing the same thing
if `inFunction && isDataDefinition`, though quite possibly that's broken
in a different way. No tests changed, anyway.

Adds a new test for the new behaviour.

Closes #1799
2025-01-29 10:07:43 +02:00
Matt Godbolt e452db56fc Special casing for msp430 (#7317)
- Make a special msp430 handler that breaks lines on `{` to fix the
weird inlining behaviour unique to msp430 output.

Closes #295
2025-01-28 10:00:04 -06:00
Patrick Quist 7234169c86 Attempt to fix remote library fetching (#7303)
Libraries were being fetched from wrong URL (on startup);
`Fetching remote libraries from
https://godbolt.org:443/api/libraries/c++`

Ended up refactoring a bunch of things to get some unittesting going on

I did not test actual startup and compilation with CE, I might have
broken something. (but @mattgodbolt tested and it looked great)
2025-01-25 09:27:03 -06:00
Filippo Barbari a53090ec92 Added check for clang-offload-bundler for Intel OneAPI >= 2024.0.0 (#7278)
Fixes #7277.
2025-01-24 11:22:03 -06:00
kevinjeon-g e4fc6cb001 Fix dex2oat on Android Kotlin (#7292)
The Kotlin compilation step results in an added 'final' in the D8 .smali
output, which we weren't accounting for. This change updates the class
name regex for .smali files to collect only the 'L<class>;' string.

This change also fixes dex2oat for Android Java in cases where 'final'
is applied to classes.
2025-01-24 17:36:23 +09:00
Andrea Tomasi ee4ab8bb5b View Elixir jitted assembly (#7282)
Hi, this PR adds a way to view the assembly code of Elixir code.

This continue the work from #6081 and #6104
2025-01-19 11:34:32 +09:00
Matt Godbolt b6ead25038 Support .base64 as a data indicator. (#7281)
Fixes #7280

@partouf I expect this will need a fix in the C++ code too, right?
2025-01-16 15:58:05 -06:00
Matt Godbolt 8ef76dd5bf Support execution and binary output in ispc (#7273)
- ispc doesn't link, so interpose running `gcc` or similar to output the final binary
- works around some naming issues in ispc

Ckoses #3937
2025-01-16 14:06:35 -06:00
narpfel 3e36414a34 [rust] switch to -C debuginfo=2 (#7266)
This is mainly for `pahole`, which requires type information that is
only present with `-C debuginfo=2`:
https://doc.rust-lang.org/rustc/codegen-options/index.html#debuginfo

CE originally passed `-g` to `rustc` (which is an alias for `-C
debuginfo=2`), but this was changed in
c4411ff2a1 to `-C debuginfo=1` to work
around https://github.com/rust-lang/rust/issues/11906. However, this
workaround never actually removed frame pointers, so switching back to
`-C debuginfo=2` should not affect codegen for very old `rustc`
versions. See also #79.
2025-01-13 20:44:11 +09:00
Ofek a101e2d9f2 Fix MSVC's handling of /link options, fix and modernize some docs (#7260)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2025-01-11 18:16:04 +02:00
Matt Godbolt b26aba77bf Handle sponsor cases with items that need to be shown every time better (#7257)
Look at the error if the item was chosen instead of the current error.
2025-01-09 19:21:49 -06:00
kevinjeon-g fd6a07d233 Add source<>disassembly highlighting for dex2oat (#7248)
oatdump, the dex2oat dump tool, doesn't output any information that can
be used to associate disassembly with source lines. However, dex2oat's
output optimization CFG (classes.cfg) does contain a final disassembly
stage that retains dex_pc.

Lines of disassembly from oatdump can be associated with lines of
disassembly in classes.cfg, and through the dex_pcs there, be mapped
back to the D8 .smali output, which does contain source line
information.
2025-01-08 11:17:17 -06:00
Waqar Ahmed e0e2420482 Improve odin codegen processing (#7228)
- Builtin runtime functions __$startup_runtime, __$cleanup_runtime, __$*
are now filtered out
- Label matching regex is fixed for odin, see OdinAsmParser class. This
ensures we filter out all labels that don't belong to the current file
- Slightly improved editor support, auto bracket closing and commenting
via keyboard shortcuts works now
- procedures within the file are automatically @require as requested by
GingerBill (odin lang creator).

There still are a lot of unused labels with data definitions that dont
get filtered out.

#7210
2025-01-06 15:49:15 -06:00
kevinjeon-g 79028a0610 Support kotlinc output for Android Kotlin (#7251)
This change adds kotlinc as an output option for Android Kotlin, and
updates kotlin.ts to allow for input libraries by parsing library paths
and passing them in with '-cp path:path:...'.

This is intended to simplify the process of inspecting kotlinc output
when Android Kotlin is already selected so that a user doesn't have to
switch to the Kotlin compiler option. This also allows a user to view
kotlinc output with Android libraries.

<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2025-01-06 15:46:54 -06:00
Ofek b97cbb33b9 Fix #7237: account for potential warning/error matches (#7238)
A warning in an old gcc (4.8.1) had a format that was accidentally
caught by the -fopt-info regex. Now accounting for potential
errors/warnings caught accidentally.

I don't like that `processOptOutput` is being called regardless of
whether `backendOptions.produceOptInfo` is set, maybe need to address it
too.
2024-12-22 11:54:29 +02:00
kevinjeon-g 5e23a935de Add full oatdump output behind filters (#7233)
This change makes full oatdump output visible behind the "Directives"
filter. This does the same thing as the --full-output flag, but is
more-easily used. The default code snippets have been updated to include
this.
2024-12-20 11:58:18 -06:00
Ofek 97b5735c21 Opt-remarks for gcc (#7230)
![gccoptrem](https://github.com/user-attachments/assets/4662c5d1-3a4e-443b-a989-bc4dc109e90b)
2024-12-20 10:19:33 +02:00
Matt Godbolt e18ada50fa Add support for QNX (#7234)
CC @doodspav
2024-12-19 16:32:13 -06:00
Partouf 64f3ae4636 fix incompatible options 2024-12-16 15:31:45 +01:00
Ofek 50a7f3ebbf Set MSVC default option to /utf-8, remove it if the user specified /source-charset or /execution-charset (#7223) 2024-12-16 13:42:16 +01:00
Steve d37e1f458a .NET: Add cross-arch codegen support for crossgen2 (#7215)
This allows users to inspect the disassembly other than x64.
2024-12-13 04:32:31 -06:00
Spencer Fricke 120e16aa59 Fix error lines for GLSL output (#7207)
glslang outputs its message strangely (and it is not going to change,
otherwise I would have made the changes there)

This will take an ouptut like

```
ERROR: <source>:4: Something bad
WARNING: <source>:5: Something less bad
```

to be

```
<source>:4: Something bad
<source>:5: warning: Something less bad
```

so it appears automatically in the UI


![image](https://github.com/user-attachments/assets/05454b10-abf7-4f81-8f26-17970028f3f8)
2024-12-09 08:06:02 -06:00
Waqar Ahmed d7f92bdb59 Improve odin codegen processing (#7204)
- support library code filter
- disable demangling, its not needed for odin
- support LLVM IR

<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2024-12-09 12:14:40 +09:00
Matt Godbolt 02951a20db Unify types for tool args (#7199)
- Uses strings across the board in the UI part (no functional change
here from before; all state is the same as it was before).
- Sends _arrays_ in the POST, using the same `splitArguments` code as
the backend.
- Backend _still supports_ strings (though doesn't advertise), also
using same `splitArguments`.
- Moves `splitArguments` into common utils, and rephrases to avoid
unnecessary use of underscore and ES2021+ code.

Tested locally:
- with both old and new client code (ran new backend and old webcode to
show sending strings still works)
- with creating and removing tool windows (checked with `ldd` locally)
- with various strings on the client `moo foo "this is bad" #moo` and
even "error" things like `this is "badger` (with a missing close quote).
All works as you'd expect

Happy to break the "move the splitArguments" code into a separate PR if
that'd be easier to review separately.

Fixes #7195
2024-12-07 14:44:42 -06:00
Mats Jun Larsen c256b922f7 Migrate site templates to yaml config (#7189)
Does some winter cleaning on the site-template stuff :)

1. Migrated away from the custom conf format to plain old yaml
2. Made the images and image files match with the name from the yaml
file. (It's not a problem to have spaces in file paths, nor urls so I
don't see why we shouldn't)
3. Updated the relevant documentation

There is a small breakage in the api response for the meta field. It now
returns `{"screenshot_dimensions":{"width":1000,"height":800}}` which I
believe is a lot more useful than
`{"meta.screenshot_dimensions":"1000x800"}`

Besides, I don't believe this endpoint has any third-party consumers
that rely on the metadata since it's a rarely known feature anyways
2024-12-08 00:59:58 +09:00
Mats Larsen 0d7d5dfc43 Remove unused body-parser dependency 2024-12-07 01:50:28 +09:00
Atharva Rai a3c64dc4dc Remove body-parser dependency (#7176)
This PR addresses issue #7158 by removing the body-parser dependency in
favor of express.json() and other built-in middleware functionalities
provided by Express.js.
2024-12-07 01:47:06 +09:00
Partouf 3aff85a216 odin fixes 2024-12-06 17:29:16 +01:00
Waqar Ahmed d3ef2de208 Add Odin language (#7186) 2024-12-06 17:28:47 +01:00
Steve 77bbd0b6dc Make the argument parsing more robust (#7185)
Instead of skipping the exactly the last option, skip all options after
the input filename.

Otherwise, in some cases there can be options like `-Wl` and etc. being
passed to the compiler and cause build failures.
2024-12-05 08:13:28 -06:00
Mats Jun Larsen 6566759c75 Hotfix static max age header (#7182)
Good catch @mattgodbolt
2024-12-04 08:13:22 -06:00
Spencer Fricke 05f86a38dd Add preliminary Slang support (#7151)
Part of
https://github.com/compiler-explorer/compiler-explorer/issues/2331 and
similar to [my GLSL
change](https://github.com/compiler-explorer/compiler-explorer/pull/6883)

[Slang](https://shader-slang.com/) is a GPU focused shading language
that has been worked on for years. Last week [The Khronos
Group](https://www.khronos.org/news/press/khronos-group-launches-slang-initiative-hosting-open-source-compiler-contributed-by-nvidia)
will now be running the project as open governance. The latest [Vulkan
SDK](https://www.lunarg.com/lunarg-releases-vulkan-sdk-1-3-296-0-for-windows-linux-macos/)
has also added a build of `Slangc` (slang compiler).

This change adds support for Slang (the language) as a front end with
`Slangc` (the compiler) as the only compiler. Slang can be used for
things like GLSL/HLSL, but that is for a future PR.

I am in contacts with people on the Slang development and plan to
support things for Slang as well as the other GPU related shading
languages

--- 

of course, screen shots as well


![image](https://github.com/user-attachments/assets/c9f6460b-b779-4ff5-b0bb-5a7eff543de1)


![image](https://github.com/user-attachments/assets/b2dbdd5a-c031-4110-ab9d-ed76b9881ad8)
2024-12-04 04:45:50 -06:00