@barracuda156 how did you learn to do these fixes? They don't look so easy to do
Custom ports for 10A190 here: https://github.com/barracuda156/macports-ports/tree/snow-ppc (fixes that will not be or unlikely to be accepted with upstream).
This is intended to be a complete replacement for the earlier archive. But not yet
I will verify what needs custom fixes still and update the branch.
DO NOT USE THIS BRANCH FOR ANY OTHER PPC SYSTEMS, including 10.6.x Rosetta.
P. S. As usual, if something fails for you on 10A190 – report here (not on Trac).
Wait.
Are you telling me you got gqrx to build successfully on 10.6PPC?!
Rosetta is not a thing you can know at compile time. Rosetta is always ppc. Real ppc can be ppc or ppc64.I asked this elsewhere but will repeat the question: if anyone knows of a way to differentiate between release 10.6.0+ with Rosetta and 10.6 PPC (pre-release, ppc native) via macros – that is, for the compiler – let me know.
This issue prevents implementing a generally acceptable fix for GCC – since any released 10.6 does not need changes we need for 10A190.
(A better way would be to fix 10A190 to match 10.6.0, of course…)
strings
on the compilers and see if they have different version numbers that you can test for.Rosetta is not a thing you can know at compile time. Rosetta is always ppc. Real ppc can be ppc or ppc64.
If you mean you are using two different SDKs and want to know when you're compiling with one SDK or the other SDK, then diff them and find something that is different between them that you can test for.
I found that 10.4u SDK defines AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER so you can't use that alone to determine if the SDK is for 10.5 so I included TARGET_OS_EMBEDDED in my 10.5 check.
https://github.com/joevt/pciutils/blob/master/lib/MacOSMacros.h
If you are not using an SDK, and are using headers and includes from root directory, you still need to do the same thing except only compare headers and includes (from the directories that would exist in an SDK).
You can download most of the SDKs from https://github.com/phracker/MacOSX-SDKs or extract them from Xcode installs.
Maybe you want to test something in the compiler such as a version number? Maybe dostrings
on the compilers and see if they have different version numbers that you can test for.
If there's no compile time macro, maybe do some tests at build time. The build script can set some environment variable which you can use in the build commands.
You want to change the behaviour of gcc rather than change what gets compiled?Perhaps I did not ask the question in a clear enough way.
Here is what GCC uses in darwin.h and what has to be changed for 10A190 (this is a general header, another is inside gcc/RS6000/config, but these fixes are not arch-specific):
Like this, it cannot be accepted into either GCC upstream or Macports, because these setting are only for pre-release 10.6 and should not be applied on 10.6.0 and later.darwin.h: fixes for 10A190 · iains/gcc-git@603494b
GCC Git mirror + Darwin Updates. Contribute to iains/gcc-git development by creating an account on GitHub.github.com
We need a finer grading than os.major and os.minor, because minor is the same for anything up to 10.6.0 release.
Kernel seems to have needed definitions, but it is not clear if those can be used and if yes then how.
They sit here: https://opensource.apple.com/source/xnu/xnu-2050.18.24/libkern/libkern/version.h.template.auto.html
Compiler macros __MAC_OS_X_VERSION_MIN_REQUIRED and __MAC_OS_X_VERSION_MAX_ALLOWED are useless here, as well as __POWERPC__ – even if we assume that only pre-release PPC version of 10.6 is relevant (discarding Intel case), 1060 && __POWERPC__ fits 10.6 release with Rosetta, so it cannot be used either.
mmacosx-version-min
just a flag you pass into gcc? So make a new flag? Or change the definition of mmacosx-version-min
so that it's more useful?version-compare
compare versions of any length? 10.6 < 10.6.0.123 < 10.6.1? Can it compare alpha and beta version? 10.6a < 10.6b < 10.6?You want to change the behaviour of gcc rather than change what gets compiled?
Isn'tmmacosx-version-min
just a flag you pass into gcc? So make a new flag? Or change the definition ofmmacosx-version-min
so that it's more useful?
Canversion-compare
compare versions of any length? 10.6 < 10.6.0.123 < 10.6.1? Can it compare alpha and beta version? 10.6a < 10.6b < 10.6?
In one of the first posts, @barracuda156 you said that m4 compiled for you but I'm unable to get it done. This is on a G4. I am just getting started with this stuff.. I had little luck on FreeBSD building and now I'm seeing that OSX is in a similar situation with a gui.
:debug:configure Error code: POSIX ENAMETOOLONG {file name too long}
:debug:configure Backtrace: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_
devel_m4/m4/work/m4-1.4.19/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-1
4B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/
confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdi
r-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B-
--/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/con
fdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-1
4B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---: file name too long
In one of the first posts, @barracuda156 you said that m4 compiled for you but I'm unable to get it done. This is on a G4. I am just getting started with this stuff.. I had little luck on FreeBSD building and now I'm seeing that OSX is in a similar situation with a gui.
:debug:configure Error code: POSIX ENAMETOOLONG {file name too long}
:debug:configure Backtrace: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_
devel_m4/m4/work/m4-1.4.19/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-1
4B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/
confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdi
r-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B-
--/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/con
fdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-1
4B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---: file name too long
I hope not. Lol..."Tiger is really the sweet spot for the old G4 machines."
"I expect that one option is to use GNU coreutils 'rm' instead of MacPorts 'rm'. Coreutils 'rm' should not have the bug you're observing."
/* Leaving behind such a deep directory is not polite.
So clean up here, right away, even though the driving
shell script would also clean up. */
$ diff -u configure.old configure
--- configure.old 2021-06-05 17:36:56.000000000 -0700
+++ configure 2021-06-05 18:48:13.000000000 -0700
@@ -36350,7 +36350,7 @@
#else
int bug_possible = 0;
#endif
- if (! bug_possible)
+ if (1)
return 0;
cwd = getcwd (NULL, 0);
Place the patch destdir-variable-fix.diff in the directory ${portpath}/files and use it in a port using the patchfiles keyword. ${portpath} may be in a local Portfile repository during development, or files/ may be in a port's ${portpath} in the global MacPorts repository.
I'm not developing.may be in a local Portfile repository during development,
or files/ may be in a port's ${portpath} in the global MacPorts repository.
You need to delete the offending directory after applying the patch. That did it for me.I hope not. Lol...
Code:/* Leaving behind such a deep directory is not polite. So clean up here, right away, even though the driving shell script would also clean up. */
To quote the solution above...
Code:$ diff -u configure.old configure --- configure.old 2021-06-05 17:36:56.000000000 -0700 +++ configure 2021-06-05 18:48:13.000000000 -0700 @@ -36350,7 +36350,7 @@ #else int bug_possible = 0; #endif - if (! bug_possible) + if (1) return 0; cwd = getcwd (NULL, 0);
I drilled down and extracted the source,
"fixed" the file and create a diff. Put that diff in, /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/m4/files/
Re-ran port install m4, and of course it is still not working.
---
I like how vague this is. Place the file in that dir, ok. Did that. Now use it in a port using the patch files keyword.
Um what. Use it in a port? What? port patch files "unrecognized action." Be clearer Macports. ${portpath} ???
Use this while running port install?
I'm not developing.
More stuff that makes no sense to me.
I understand patching a config file, running that, make, make install.
I understand, kind of, putting a diff file in there.
But what I don't understand (because it's not even documented apparently), is how I'm supposed to be using this diff file with macports. Btw I ended up trying to put my diff file into every single possible source dir and running their patch command and it doesn't work.
But what I don't understand (because it's not even documented apparently), is how I'm supposed to be using this diff file with macports. Btw I ended up trying to put my diff file into every single possible source dir and running their patch command and it doesn't work.
sudo port deactivate legacy-support
sudo port install legacy-support-devel