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

Bool size in Darwin ppc ABI is 4-byte (Windows too?) #319

Open
barracuda156 opened this issue Jul 22, 2023 · 8 comments
Open

Bool size in Darwin ppc ABI is 4-byte (Windows too?) #319

barracuda156 opened this issue Jul 22, 2023 · 8 comments

Comments

@barracuda156
Copy link
Contributor

Apparently on Windows bool is also 4-byte, according to: d0a90be
However tests header defined bool as uint8_t:

typedef uint8_t BOOL;

I am not sure about how it works on Windows; to accommodate Darwin ppc it will be needed to do smth like:

#if defined(__APPLE__) && defined(__ppc__)
typedef uint32_t BOOL;
#else
typedef uint8_t BOOL;
#endif
@barracuda156 barracuda156 changed the title Bool size in Darwin ppc ABI is 4-byte Bool size in Darwin ppc ABI is 4-byte (Windows too?) Jul 22, 2023
@flibitijibibo
Copy link
Member

I think the typedef is just to alias the BOOL name, since FAudio itself uses uint8_t, but if making it uint32_t makes it work for ppc I can merge that in!

@barracuda156
Copy link
Contributor Author

@flibitijibibo Thank you for responding (and for merging the PR!).

I got some issue with running tests: once launched, the binary does nothing, essentially freezing, and GDB does not show any meaningful output (it also hangs after Reading symbols for shared libraries).
So no need to change bool there right now, I think. Unless tests actually run (even with failures), that is pointless anyway.

P. S. It is quite possible our SDL2 is not working correctly on PPC (it is in experimental status), but I would expect tests failing, if so, but not being unable to even start. Apparently something unrelated to SDL2 is broken, but I have no idea what.

@flibitijibibo
Copy link
Member

Not sure about the tests, but the utils might narrow it down a bit - the utils don't do any winapi mapping so it should be possible to run those and get some output without any alignment weirdness happening.

@barracuda156
Copy link
Contributor Author

@flibitijibibo Sorry for a silly question, where to find those utils? They are not installed, and I am not sure they are built by default.

@flibitijibibo
Copy link
Member

I think the CMake option is BUILD_UTILS, it won't be on by default (phoneposting atm).

@barracuda156
Copy link
Contributor Author

barracuda156 commented Jul 25, 2023

I should have looked into CMakeLists, will try it now.

UPD. facttool launches, for example, but looks like this (may be SDL2 issue though):
faudio
(initial dyld error is caused by library paths set in the binaries – they point to install prefix, while I ran binary without installing libs first; so ignore that).

P. S. I wonder if FAudio works on macOS at all. Portfile has a note that utils segfaulted, and be sure, this was not on PowerPC: https://github.com/macports/macports-ports/blob/380698f05626c4949bb30834dda86039d707bbc0/audio/FAudio/Portfile#L42-L43

@barracuda156
Copy link
Contributor Author

@flibitijibibo So utilities launch and at least their menus work, though fonts are displayed in a barely readable fashion.
Ironically, this did not help in any way to understand why tests do not start, since utilities are kind of okay.

@barracuda156
Copy link
Contributor Author

When I run with GDB, I get this (and I have to interrupt the process, as it freezes):

36-25% sudo gdb ./faudio_tests                                                 GNU gdb 6.3.50-20050815 (Apple version gdb-1314.1) (Sun Nov 16 22:48:12 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-apple-darwin"...Reading symbols for shared libraries .... done

(gdb) run
Starting program: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_audio_FAudio/FAudio/work/build/faudio_tests 
Reading symbols for shared libraries +++................................................................................................... done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
^C
Program received signal SIGINT, Interrupt.
0x00250e18 in semaphore_timedwait_signal_trap ()

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

No branches or pull requests

2 participants