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

Replacing the Old Backend with the New Backend Transition Period #891

Closed
gingerBill opened this issue Mar 31, 2021 · 14 comments · Fixed by #914
Closed

Replacing the Old Backend with the New Backend Transition Period #891

gingerBill opened this issue Mar 31, 2021 · 14 comments · Fixed by #914

Comments

@gingerBill
Copy link
Member

Is your feature request related to a problem? Please describe.
Replacing the Old Backend with the New Backend.

Describe the solution you'd like

  • Replace the old backend with the new backend
  • Make the CI for the nightly builds compile the new backend for all platforms
  • Transition this over a period of weeks until everything is stable and tested

Additional context

  • The new backend is nearly fully functioning with code generation working at all optimization levels.
  • The new generated code is better than the old backend (not full exhaustive testing but good enough).
  • The new backend generates debug symbols correctly, and with much better detail the old backend end ever did.
  • The new backend can be up to date with the LLVM versions much quicker and allow for better uses of newer features.
  • New backend can be parallelized with having multiple modules (for development builds) allow for faster compile times (due to LLVM scaling O(N^2) with the size of module).
  • Having to maintain one less backend makes everyone's life a lot easier
@Platin21
Copy link
Contributor

Platin21 commented Mar 31, 2021

We right now don’t have the correct flags for building on macOS with brew llvm.
Ideally that build would also set the Rpath‘s

@powerc9000
Copy link
Contributor

We right now don’t have the correct flags for building on macOS with brew llvm.
Ideally that build would also set the Rpath‘s

For what it's worth. This is what I had to do to compile with brew llvm clang src/main.cpp -Wno-switch -Wno-pointer-sign -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare -Wno-macro-redefined -std=c++11 -DGIT_SHA=\"685b42d8\" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -L /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib -O3 -march=native -pthread -ldl -lm -lstdc++ -liconv -o odin

@gingerBill
Copy link
Member Author

@Platin21

We right now don’t have the correct flags for building on macOS with brew llvm.
Ideally that build would also set the Rpath‘s

Mac M1 support was pretty simple to add now that llvm is easy to install. I did not require that complex of a build system that @powerc9000 has written to get it working, but I support the Intel Macs do require all of that to work.

@Platin21
Copy link
Contributor

Platin21 commented Mar 31, 2021

I did jet not try to use the m1 build sh file but i thought a unified way todo this for macOS in say the makefile would actually make more sense.

@powerc9000 it doesn’t require a -lLLVM-C i suppose it’s somehow in the ldpath somehow.

@gingerBill
Copy link
Member Author

Another thing for the transition period with @ThisDrunkDane has suggested is to get the new backend compiling with CI for all platforms and then just remove the old backend straightaway. If people require the old backend still, they can still use a previous version if necessary.

@gingerBill
Copy link
Member Author

n.b. This is not an April Fool's Joke.

@Platin21
Copy link
Contributor

Platin21 commented Apr 2, 2021

I didn‘t expect anything else maybe we should also switch to makefiles for nix completely.

@ThisDevDane
Copy link
Member

I would prefer if we switch to makefiles completely for all platforms.

@Kelimion
Copy link
Member

Kelimion commented Apr 2, 2021

That would add another dependency to Odin for Windows, like mingw. Alternatively, we could implement our own make in Odin, one that works across platforms, and ship a compiled version of it with releases.

@Platin21
Copy link
Contributor

Platin21 commented Apr 2, 2021

Also a option still requires a initial build system or is the consideration doing that manually?

@ThisDevDane
Copy link
Member

That would add another dependency to Odin for Windows, like mingw. Alternatively, we could implement our own make in Odin, one that works across platforms, and ship a compiled version of it with releases.

It's a dependency we already have? You need the VS build tools to build on windows and nmake is included in that which can build makefiles

@Platin21
Copy link
Contributor

Platin21 commented Apr 2, 2021

Ohh so there is make anyways on each platform hmm then upvote for using make everywhere.

@gingerBill
Copy link
Member Author

gingerBill commented Apr 19, 2021

-llvm-api appears to work fine unofficially for Linux and Mac on AMD64. We just need to get the CI building those backends correctly. Once that happens, two things can happen:

CC: @ThisDrunkDane

@ThisDevDane
Copy link
Member

ThisDevDane commented Apr 21, 2021

I'll get started on that then, should be fairly simple to do if I leave out the entire "build LLVM in the CI itself"

@gingerBill gingerBill linked a pull request Apr 25, 2021 that will close this issue
@gingerBill gingerBill unpinned this issue Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants