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

Open
opened 2023-07-22 12:11:16 -05:00 by barracuda156 · 8 comments
barracuda156 commented 2023-07-22 12:11:16 -05:00 (Migrated from github.com)

Apparently on Windows bool is also 4-byte, according to: github.com/FNA-XNA/FAudio@d0a90be698
However tests header defined bool as uint8_t: github.com/FNA-XNA/FAudio@c5f8246875/tests/FAudio_compat.h (L5)

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
Apparently on Windows bool is also 4-byte, according to: https://github.com/FNA-XNA/FAudio/commit/d0a90be6984cde9ea37715b2607930eb227877c1 However tests header defined bool as `uint8_t`: https://github.com/FNA-XNA/FAudio/blob/c5f82468756471ec23efea1481e559038f01317b/tests/FAudio_compat.h#L5 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 ```
flibitijibibo commented 2023-07-22 12:21:41 -05:00 (Migrated from github.com)

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!

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 commented 2023-07-22 12:35:30 -05:00 (Migrated from github.com)

@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 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 commented 2023-07-22 12:47:55 -05:00 (Migrated from github.com)

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.

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 commented 2023-07-23 10:33:12 -05:00 (Migrated from github.com)

@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 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 commented 2023-07-23 13:28:48 -05:00 (Migrated from github.com)

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

I think the CMake option is BUILD_UTILS, it won't be on by default (phoneposting atm).
barracuda156 commented 2023-07-24 22:48:21 -05:00 (Migrated from github.com)

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: github.com/macports/macports-ports@380698f056/audio/FAudio/Portfile (L42-L43)

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](https://github.com/FNA-XNA/FAudio/assets/92015510/e016c648-a9bd-48a9-a412-197c1c31154b) (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 commented 2023-07-24 23:14:52 -05:00 (Migrated from github.com)

@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.

@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 commented 2023-07-24 23:22:13 -05:00 (Migrated from github.com)

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 ()
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 in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-FNA-XNA/FAudio#319
No description provided.