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

FREEMINT: Add FreeMiNT toolchain #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ccawley2011
Copy link
Member

TODO:

  • Build m68020-60 and m5475 toolchains and libraries
  • Add missing dependencies for SDL 1.2
  • Use fixed commits for binutils, gcc, mintlib, mintbin and fdlibm.
  • Fix libmpeg2 compiler error
  • Add libraries used by scummvm-tools.
  • Remove the patch once Fix generating bison output for pars.y freemint/mintlib#48 is merged.

@mikrosk
Copy link

mikrosk commented Feb 20, 2023

@ccawley2011 that's very nice of you. Is there a log somewhere to look at? I see that you have discovered my toolchain Makefile, I use it quite often on my Arch Linux machine, so it should really be just a matter of calling that Makefile with the right parameters.

When you clone my repository, you can do either:
make all-skip-native

or

make m68000-skip-native, make m68020-60-skip-native, make m5475-skip-native

That should do the trick and produces stuff in $HOME/gnu-tools/{m68000, m68020-60, m5475}.

If m68000 target works, there really shouldn't be any trouble with the other two.

@th-otto
Copy link

th-otto commented Feb 20, 2023

Wouldn't it be easier to just install the ppa archive from vincent rather than compiling mintlib from source?

@mikrosk
Copy link

mikrosk commented Feb 20, 2023

C++11 support (required by ScummVM) is available since gcc 4.8 officially, so unless Vincent decides to upgrade, I'd say it would not.

If you are asking about mintlib specifically then perhaps it's best to use the latest one, Vincent's is often very outdated as he doesn't update the package very often.

@th-otto
Copy link

th-otto commented Feb 20, 2023

Not very often, but he did not long ago, so that should be fairly recent.

Another possibility would be to just fetch the snapshots and install them, just like we dont in freemint when compiling other packages like toswin2. But those are just tar archives, not debian packages.

@mikrosk
Copy link

mikrosk commented Feb 20, 2023

Indeed, that's also an option. I guess @ccawley2011 has taken the easy approach here, one command compiles everything needed.

@ccawley2011
Copy link
Member Author

Is there a log somewhere to look at?

I've attached a build log when attempting to build with all-skip-native: freemint-log.txt.gz. It seems to be unable to find the built-in GCC version of limits.h when building the m68020-60 version.

@mikrosk
Copy link

mikrosk commented Feb 20, 2023

That's odd. Can you please patch Makefile to remove all occurrences of -j3 (like here: https://github.com/mikrosk/m68k-atari-mint-build/blob/master/Makefile#L196) and attach the log again? I'll compare it then with my local build, maybe it's something obvious which is not visible in the messed-up output now.

@th-otto
Copy link

th-otto commented Feb 21, 2023

Well but i won't merge that pull-request into mintlib, since that will break parallel makes there again.
Can you point me to a log where mintlib without your patch gives problems in your buildbot?

BTW, for c++11 you'll need a newer version of gcc, but not necessarily a newer version of mintlib. It might also depend which c++11 features are actually used, some of them were already implemented in earlier versions. See https://gcc.gnu.org/projects/cxx-status.html#cxx11


helpers_package(fribidi)

# TODO: GEM, LDG and pth, for SDL
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gemlib can be installed from https://github.com/freemint/gemlib

IMHO pth is an overkill even for the SDL port, there's no real use case for threads on our platform. Also, it makes the port really FreeMiNT-specific (it isn't the only OS for the Atari platform), so I've always used --disable-threads in my SDL builds.

LDG can be found at https://sourceforge.net/projects/ldg and it has a bit awkward build process (especially for 68020+ and ColdFire) but I can help you out if you want.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO pth is an overkill even for the SDL port, there's no real use case for threads on our platform. Also, it makes the port really FreeMiNT-specific (it isn't the only OS for the Atari platform), so I've always used --disable-threads in my SDL builds.

Does SDL audio work without threads? I know that using interrupts is unreliable on other platforms like the Nintendo DS because the mixer isn't always fast enough.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I have always disabled them and released quite a few SDL ports, I'm inclined to say that it does. There could be some corner cases but I'm not aware of them.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the worst case we can again re-enable them.

# TODO: GEM, LDG and pth, for SDL

# COPY packages/libsdl1.2 lib-helpers/packages/libsdl1.2/
helpers_package(libsdl1.2, --disable-video-opengl --disable-threads)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, so you actually do disable them. In that case pth is really not needed.


do_http_fetch m68k-atari-mint-build "https://github.com/mikrosk/m68k-atari-mint-build/archive/${TOOLCHAIN_VERSION}.tar.gz" 'tar xzf'

# TODO: Build the m68020-60 and 5475 toolchains as well
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I have now realised that you don't need to build those at all.

They are useful only for building native (68020+ / ColdFire) compilers. The usual way on our platform is to override CFLAGS / CXXFLAGS, i.e. adding -m68020-60 / -mcpu=5475, usually along with -fomit-frame-pointer (which is not very useful and has a performance hit).

Another approach would be to override ENV INSTALL_DIR and PREFIX so they point to the proper sys-root for given CPU (i.e. no multilib setup but separated environment for every CPU) but mintlib, gemlib and others require some tweaks for such scenario (i.e. not to build their multilib variants what is done by default).

@mikrosk
Copy link

mikrosk commented Feb 22, 2023

Btw, I have successfully run make all-skip-native in a clean Ubuntu 22.04.2 environment (with @ccawley2011's mintlib patch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants