-
Notifications
You must be signed in to change notification settings - Fork 155
Updates for Darwin, FreeBSD i386 and amd64 #328
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- prepare stdlib.bi for fall back to unix include when not specifically given for the target
…ere is no specifc stdlib.bi for the target
…types.bi - add custom crt headers for freebsd to pick up types needed to build the test suite crt-headers: guard wchar_t and wint_t - ideally we should like to only have this defined in one place crt-headers: move wmemcpy() up in to inc/crt/wchar.bi and - assume wmemcpy() it exists on all targets. If it doesn't move it back some time later
- xargs on freebsd does not support the '-a filename' option, use 'cat filename | xargs' instead
- fb_AtomicSetThreadFlags() is needed in the non-multithreaded rtlib - threading functions are still available in the non-multithreaded rtlib - it is needed by thread_core.c:threadproc() - unusual but not impossible to link the non-multithreaded rtlib and call thread functions
What are not supported are .a files which are actually fat/universal binaries rather than ar archives. However, I have yet to encounter any of these, and fbc itself will not create them, so there should be no problem.
…O targets, used by objinfo.bas
…DATA Updated gas, gcc and llvm backends, but haven't tested llvm. On Darwin the assembler/linker are a bit different; it is necessary to provide a segment, section pair rather than just a section name. It is possible to use any segment name we want, but since it isn't stripped, putting it in a new segment would only increase bloat. Also, use "fbctinf" rather than ".fbctinf" on darwin, where section names aren't normally prefixed with .
…ad of '.fbctinf' (TeeEmCee)
…procedure. This is necessary in order to use SDL 1.2 or SDL 2.0 on at least Android, OSX, iOS, and winRT, and is optional on Windows. SDL_main.h #defines main to SDL_main, and declares the real main() itself. Under FB that can't be done, so the solution is to pass -entry SDL_main when compiling the main module. No guarentees that that is all that is needed to properly initialise a FB program under SDL. Note: I wasn't sure where to put this global. env.clopt.entry would seem to be the natural place, but env.clopt contains only integral datatypes, and file-scope for other structures like fbc seems to be strictly enforced. So it went into fbc and then passed to fbInit and put in env.
I don't emit the ctor/dtor priorities, because they are simply not supported by the darwin dyld. The most that the gas backend can do is to ensure that ctors/dtors are placed in the right order within a single module. Which of course isn't implemented.
Apple gas diverged long ago from FSF/GNU gas, and there are many incompatibilities, especially in intel syntax support. Also noted (in a comment) that one of the gcc flags we use is not compatible with, for example gcc 4.2, so you need a fairly recent gcc.
…for -gen gas Of all the Apple and MacPorts gcc and clang compilers I tried, only clang 3.6 and 3.8 from MacPorts supported -masm=intel, while Apple gcc and clang and MP gcc were compiled with support disabled.
This doesn't seem to cause any problems when the corresponding Mac SDK isn't installed.
This tells ld what is expected when crosscompiling to 32/64 bit when the default architecture is the opposite.
Because symbUniqueId already generates identifiers stating with Lt_ I changed symbUniqueLabel to use L_ (darwin) or .L_ (elsewhere) prefixes instead of .Lt_
…sed-but-set-variable In order to disable that warning, disable whole family of warnings instead; -Wno-unused. Unforunately, newer versions of gcc ignore unknown warning flags, but that's also a recent feature.
It's necessary to use the as and ld packaged with gcc rather than the system ones.
- allow freebsd-i386 to pass the tan() accuracy test - also allow showing the failed test if ENABLE_CHECK_BUGS=1 is defined - tan() function on freebsd-i386 has different accuracy - tan() function was modified to have greater accuracy in freebsd's implementation of the math library - the accuracy may vary depending on which c runtime was linked in and which builtins were used
- the objinfo features writes extra information to object files and libraries - this information is read back by fbc when fbc to determine some compile time options and required library names
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is mostly from an old branch of @rversteegen (TeeEmCee) which had the bulk of the changes for freebsd and Darwin. A few changes from myself while building and testing on freebsd.
The freebsd changes were tested on FreeBSD 13.0 i386 & amd64
Result so far natively on FreeBSD vm's:
Darwin changes reviewed only. I wasn't able to test. However, it's reasonable to include the changes for Darwin, because:
Changes / fixes - all targets
Updates for Darwin (TeeEmCee)
Updates for freebsd 13.0 i386 & amd64