darwin-xtools icon indicating copy to clipboard operation
darwin-xtools copied to clipboard

darwin-xtools-1-1-0 fails to build on 10.5.8 with gcc7

Open barracuda156 opened this issue 2 years ago • 9 comments

36-138:~ arjuna$ cmake -C /Users/arjuna/Dev/darwin-xtools-10-5.cmake /Users/arjuna/Dev/darwin-xtools
loading initial cache file /Users/arjuna/Dev/darwin-xtools-10-5.cmake
CMake Deprecation Warning at CMakeLists.txt:17 (cmake_policy):
  The OLD behavior for policy CMP0051 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/local/bin/gcc-mp-7 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/local/bin/g++-mp-7 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- *Top Level* native build
-- *Top Level* NO LTO
-- *top config-ix* CMAKE_SYSTEM : Darwin-9.8.0
-- Performing Test XTOOLS_C_HAS_FPIC_FLAG
-- Performing Test XTOOLS_C_HAS_FPIC_FLAG - Success
-- Performing Test XTOOLS_C_HAS_WNODEPRECATED_FLAG
-- Performing Test XTOOLS_C_HAS_WNODEPRECATED_FLAG - Success
-- Performing Test XTOOLS_C_HAS_FNOCOMMON_FLAG
-- Performing Test XTOOLS_C_HAS_FNOCOMMON_FLAG - Success
-- Performing Test XTOOLS_CXX_HAS_STDCXX11_FLAG
-- Performing Test XTOOLS_CXX_HAS_STDCXX11_FLAG - Success
-- Performing Test XTOOLS_CXX_HAS_STDLIB_FLAG
-- Performing Test XTOOLS_CXX_HAS_STDLIB_FLAG - Failed
-- Performing Test XTOOLS_CXX_HAS_STATICCXX_FLAG
-- Performing Test XTOOLS_CXX_HAS_STATICCXX_FLAG - Success
-- Looking for C++ include unordered_map
-- Looking for C++ include unordered_map - found
-- Looking for strnlen
-- Looking for strnlen - not found
-- Looking for strndup
-- Looking for strndup - not found
-- Looking for OSAtomicAdd64
-- Looking for OSAtomicAdd64 - not found
-- Looking for map_fd
-- Looking for map_fd - found
-- Looking for xar_extract_tobuffersz
-- Looking for xar_extract_tobuffersz - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/arjuna
36-138:~ arjuna$ make
[  0%] Building C object strlib/CMakeFiles/strlib.dir/strnlen.c.o
[  0%] Building C object strlib/CMakeFiles/strlib.dir/strndup.c.o
[  0%] Linking C static library ../archs/libstrlib.a
[  0%] Built target strlib
[  0%] Building C object xar-additions/CMakeFiles/xarextralib.dir/xar-additions.c.o
[  1%] Linking C static library ../archs/libxarextralib.a
[  1%] Built target xarextralib
[  1%] Building CXX object ld64/src/CMakeFiles/prunetrie.dir/other/PruneTrie.cpp.o
[  1%] Linking CXX static library ../../archs/libprunetrie.a
[  1%] Built target prunetrie
[  1%] Building CXX object ld64/src/ld/CMakeFiles/ld.dir/Options.cpp.o
[  1%] Building CXX object ld64/src/ld/CMakeFiles/ld.dir/ld.cpp.o
[  2%] Building C object ld64/src/ld/CMakeFiles/ld.dir/debugline.c.o
[  2%] Building CXX object ld64/src/ld/CMakeFiles/ld.dir/InputFiles.cpp.o
[  2%] Building CXX object ld64/src/ld/CMakeFiles/ld.dir/SymbolTable.cpp.o
[  3%] Building CXX object ld64/src/ld/CMakeFiles/ld.dir/Resolver.cpp.o
[  3%] Building CXX object ld64/src/ld/CMakeFiles/ld.dir/OutputFile.cpp.o
[  3%] Building CXX object ld64/src/ld/CMakeFiles/ld.dir/Snapshot.cpp.o
[  3%] Building CXX object ld64/src/ld/CMakeFiles/ld.dir/parsers/macho_relocatable_file.cpp.o
[  4%] Building CXX object ld64/src/ld/CMakeFiles/ld.dir/parsers/archive_file.cpp.o
[  4%] Building CXX object ld64/src/ld/CMakeFiles/ld.dir/parsers/lto_file.cpp.o
[  4%] Building CXX object ld64/src/ld/CMakeFiles/ld.dir/parsers/macho_dylib_file.cpp.o
[  5%] Building CXX object ld64/src/ld/CMakeFiles/ld.dir/parsers/textstub_dylib_file.cpp.o
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:30: error: 'std::function' has not been declared
  void parseFlowSequence(std::function<void (Token)> func) {
                              ^~~~~~~~
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:38: error: expected ',' or '...' before '<' token
  void parseFlowSequence(std::function<void (Token)> func) {
                                      ^
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp: In member function 'void {anonymous}::TBDFile::parseFlowSequence(int)':
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:261:4: error: 'func' was not declared in this scope
    func(token);
    ^~~~
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:261:4: note: suggested alternative: 'sync'
    func(token);
    ^~~~
    sync
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp: In member function 'void {anonymous}::TBDFile::parseAllowedClients({anonymous}::DynamicLibrary&)':
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:272:4: error: no matching function for call to '{anonymous}::TBDFile::parseFlowSequence({anonymous}::TBDFile::parseAllowedClients({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>)'
   });
    ^
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note: candidate: void {anonymous}::TBDFile::parseFlowSequence(int)
  void parseFlowSequence(std::function<void (Token)> func) {
       ^~~~~~~~~~~~~~~~~
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note:   no known conversion for argument 1 from '{anonymous}::TBDFile::parseAllowedClients({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>' to 'int'
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp: In member function 'void {anonymous}::TBDFile::parseReexportedDylibs({anonymous}::DynamicLibrary&)':
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:280:4: error: no matching function for call to '{anonymous}::TBDFile::parseFlowSequence({anonymous}::TBDFile::parseReexportedDylibs({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>)'
   });
    ^
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note: candidate: void {anonymous}::TBDFile::parseFlowSequence(int)
  void parseFlowSequence(std::function<void (Token)> func) {
       ^~~~~~~~~~~~~~~~~
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note:   no known conversion for argument 1 from '{anonymous}::TBDFile::parseReexportedDylibs({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>' to 'int'
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp: In member function 'void {anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)':
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:287:5: error: no matching function for call to '{anonymous}::TBDFile::parseFlowSequence({anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>)'
    });
     ^
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note: candidate: void {anonymous}::TBDFile::parseFlowSequence(int)
  void parseFlowSequence(std::function<void (Token)> func) {
       ^~~~~~~~~~~~~~~~~
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note:   no known conversion for argument 1 from '{anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>' to 'int'
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:293:5: error: no matching function for call to '{anonymous}::TBDFile::parseFlowSequence({anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>)'
    });
     ^
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note: candidate: void {anonymous}::TBDFile::parseFlowSequence(int)
  void parseFlowSequence(std::function<void (Token)> func) {
       ^~~~~~~~~~~~~~~~~
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note:   no known conversion for argument 1 from '{anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>' to 'int'
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:299:5: error: no matching function for call to '{anonymous}::TBDFile::parseFlowSequence({anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>)'
    });
     ^
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note: candidate: void {anonymous}::TBDFile::parseFlowSequence(int)
  void parseFlowSequence(std::function<void (Token)> func) {
       ^~~~~~~~~~~~~~~~~
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note:   no known conversion for argument 1 from '{anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>' to 'int'
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:305:5: error: no matching function for call to '{anonymous}::TBDFile::parseFlowSequence({anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>)'
    });
     ^
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note: candidate: void {anonymous}::TBDFile::parseFlowSequence(int)
  void parseFlowSequence(std::function<void (Token)> func) {
       ^~~~~~~~~~~~~~~~~
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note:   no known conversion for argument 1 from '{anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>' to 'int'
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:311:5: error: no matching function for call to '{anonymous}::TBDFile::parseFlowSequence({anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>)'
    });
     ^
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note: candidate: void {anonymous}::TBDFile::parseFlowSequence(int)
  void parseFlowSequence(std::function<void (Token)> func) {
       ^~~~~~~~~~~~~~~~~
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note:   no known conversion for argument 1 from '{anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>' to 'int'
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp: In member function 'bool {anonymous}::TBDFile::parseArchFlowSequence({anonymous}::Token)':
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:326:5: error: no matching function for call to '{anonymous}::TBDFile::parseFlowSequence({anonymous}::TBDFile::parseArchFlowSequence({anonymous}::Token)::<lambda({anonymous}::Token)>)'
    });
     ^
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note: candidate: void {anonymous}::TBDFile::parseFlowSequence(int)
  void parseFlowSequence(std::function<void (Token)> func) {
       ^~~~~~~~~~~~~~~~~
/Users/arjuna/Dev/darwin-xtools/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:7: note:   no known conversion for argument 1 from '{anonymous}::TBDFile::parseArchFlowSequence({anonymous}::Token)::<lambda({anonymous}::Token)>' to 'int'
make[2]: *** [ld64/src/ld/CMakeFiles/ld.dir/parsers/textstub_dylib_file.cpp.o] Error 1
make[1]: *** [ld64/src/ld/CMakeFiles/ld.dir/all] Error 2
make: *** [all] Error 2
36-138:~ arjuna$ 

barracuda156 avatar Dec 16 '21 12:12 barracuda156

@iains I actually got the same error using newly-built gcc10. I guess I do something wrong at configure stage?

[  5%] Building CXX object ld64/src/ld/CMakeFiles/ld.dir/parsers/textstub_dylib_file.cpp.o
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:30: error: ‘std::function’ has not been declared
  252 |  void parseFlowSequence(std::function<void (Token)> func) {
      |                              ^~~~~~~~
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:38: error: expected ‘,’ or ‘...’ before ‘<’ token
  252 |  void parseFlowSequence(std::function<void (Token)> func) {
      |                                      ^
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp: In member function ‘void {anonymous}::TBDFile::parseFlowSequence(int)’:
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:261:4: error: ‘func’ was not declared in this scope
  261 |    func(token);
      |    ^~~~
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp: In member function ‘void {anonymous}::TBDFile::parseAllowedClients({anonymous}::DynamicLibrary&)’:
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:272:4: error: cannot convert ‘{anonymous}::TBDFile::parseAllowedClients({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>’ to ‘int’
  272 |   });
      |    ^
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:25: note:   initializing argument 1 of ‘void {anonymous}::TBDFile::parseFlowSequence(int)’
  252 |  void parseFlowSequence(std::function<void (Token)> func) {
      |                         ^~~~~~~~~~~~~
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp: In member function ‘void {anonymous}::TBDFile::parseReexportedDylibs({anonymous}::DynamicLibrary&)’:
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:280:4: error: cannot convert ‘{anonymous}::TBDFile::parseReexportedDylibs({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>’ to ‘int’
  280 |   });
      |    ^
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:25: note:   initializing argument 1 of ‘void {anonymous}::TBDFile::parseFlowSequence(int)’
  252 |  void parseFlowSequence(std::function<void (Token)> func) {
      |                         ^~~~~~~~~~~~~
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp: In member function ‘void {anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)’:
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:287:5: error: cannot convert ‘{anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>’ to ‘int’
  287 |    });
      |     ^
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:25: note:   initializing argument 1 of ‘void {anonymous}::TBDFile::parseFlowSequence(int)’
  252 |  void parseFlowSequence(std::function<void (Token)> func) {
      |                         ^~~~~~~~~~~~~
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:293:5: error: cannot convert ‘{anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>’ to ‘int’
  293 |    });
      |     ^
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:25: note:   initializing argument 1 of ‘void {anonymous}::TBDFile::parseFlowSequence(int)’
  252 |  void parseFlowSequence(std::function<void (Token)> func) {
      |                         ^~~~~~~~~~~~~
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:299:5: error: cannot convert ‘{anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>’ to ‘int’
  299 |    });
      |     ^
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:25: note:   initializing argument 1 of ‘void {anonymous}::TBDFile::parseFlowSequence(int)’
  252 |  void parseFlowSequence(std::function<void (Token)> func) {
      |                         ^~~~~~~~~~~~~
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:305:5: error: cannot convert ‘{anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>’ to ‘int’
  305 |    });
      |     ^
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:25: note:   initializing argument 1 of ‘void {anonymous}::TBDFile::parseFlowSequence(int)’
  252 |  void parseFlowSequence(std::function<void (Token)> func) {
      |                         ^~~~~~~~~~~~~
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:311:5: error: cannot convert ‘{anonymous}::TBDFile::parseSymbols({anonymous}::DynamicLibrary&)::<lambda({anonymous}::Token)>’ to ‘int’
  311 |    });
      |     ^
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:25: note:   initializing argument 1 of ‘void {anonymous}::TBDFile::parseFlowSequence(int)’
  252 |  void parseFlowSequence(std::function<void (Token)> func) {
      |                         ^~~~~~~~~~~~~
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp: In member function ‘bool {anonymous}::TBDFile::parseArchFlowSequence({anonymous}::Token)’:
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:326:5: error: cannot convert ‘{anonymous}::TBDFile::parseArchFlowSequence({anonymous}::Token)::<lambda({anonymous}::Token)>’ to ‘int’
  326 |    });
      |     ^
/Users/svacchanda/darwin-xtools 1.1.0/ld64/src/ld/parsers/textstub_dylib_file.cpp:252:25: note:   initializing argument 1 of ‘void {anonymous}::TBDFile::parseFlowSequence(int)’
  252 |  void parseFlowSequence(std::function<void (Token)> func) {
      |                         ^~~~~~~~~~~~~
make[2]: *** [ld64/src/ld/CMakeFiles/ld.dir/parsers/textstub_dylib_file.cpp.o] Error 1
make[1]: *** [ld64/src/ld/CMakeFiles/ld.dir/all] Error 2
make: *** [all] Error 2

barracuda156 avatar Jan 02 '22 01:01 barracuda156

OK So there are two sources of build failure here, both of which result from modernisation of GCC (the 1-1-0 branch was originally built with gcc-5).

  1. GCC now defaults to -fno-common, which is actually a better default for Darwin anyway. So we need to add a bunch of "extern"s to variables declared as private_extern (which currently only affects visibility)

  2. As the compiler(s) change the headers that get transitively included tend to reduce (although there seem still to be relatively more for clang). SO what this means is that we then get build errors because some C++ feature has not been described.

I've fixed these two - and the branch builds with gcc-5-4, gcc7-5 and gcc-10-3-ppc.

BUT there are still some things to do - because we have a problem with conflicts between the GCC-installed libstdc++.dylib and /usr/lib/libstdc++ (this is not specific to xtools, it's a general problem). There are ways to work around it - but those involve building the other dependencies.

So - some additional work is needed (I will see what can be done - but it's not going to be quick).

iains avatar Jan 02 '22 14:01 iains

@iains

I've fixed these two - and the branch builds with gcc-5-4, gcc7-5 and gcc-10-3-ppc.

Thank you so much!

Once built, are these xtools to be used as replacements for Apple ones, or how to employ them for the good?

BUT there are still some things to do - because we have a problem with conflicts between the GCC-installed libstdc++.dylib and /usr/lib/libstdc++ (this is not specific to xtools, it's a general problem). There are ways to work around it - but those involve building the other dependencies. So - some additional work is needed (I will see what can be done - but it's not going to be quick).

I will build whatever needed according to your guidelines (when you will get time to deal with this matter).

P. S. It won’t hurt if I install these into 10A190 too, right? After building on 10.5.8 PPC as universal succeeds on my end, I wanna try building as ppc32 for 10.6 PPC (or if native build fails, pre-building on 10.5.8 probably works anyway). I know @kencu is very skeptical of 10.6, but I want to improve it and see where it may lead. So far only ppc64 support appears to be a major issue on it – but it is problematic even on 10.5.8: for example, none of python3* builds correctly for ppc+ppc64 by Macports (actually they didn’t build at all, I have made patches to them, and now they build through completion, but some modules remain unusable).

barracuda156 avatar Jan 02 '22 15:01 barracuda156

First: I do not think you need xtools, at all, unless you are running into problems building exes. I originally spent the time doing this because it was impossible to build larger LLVM exes with ld64-85.2.1 because of the branch islanding issue.

However I do use the standard as / ld on every Darwin platform where possible - so for building GCC etc there is no need for xtools.

I will build whatever needed according to your guidelines (when you will get time to deal with this matter).

Some more time will be needed .

P. S. It won’t hurt if I install these into 10A190 too, right? After building on 10.5.8 PPC as universal succeeds on my end, I wanna try building as ppc32 for 10.6 PPC (or if native build fails, pre-building on 10.5.8 probably works anyway). I know @kencu is very skeptical of 10.6, but I want to improve it and see where it may lead.

Same comment as above, use the tools from Xcode unless there is a problem.***

So far only ppc64 support appears to be a major issue on it – but it is problematic even on 10.5.8: for example, none of python3* builds correctly for ppc+ppc64 by Macports (actually they didn’t build at all, I have made patches to them, and now they build through completion, but some modules remain unusable).

My main interest is in improving ppc64 (I have several ppc32 machines, but they are really too slow for the modern compilers - my oldest AGP G4 takes ≈ 1 week to build and test GCC)... .... having said that, we always start with the powerpc- tools, so they will remain supported.

==== *** one day I do hope that we can declare a "unified" set of tools that support the older platforms, but at present almost all of the volunteer time is going into the arm64 port -so you will need to be patient :)

iains avatar Jan 02 '22 15:01 iains

First:

I do not think you need xtools, at all, unless you are running into problems building exes. I originally spent the time doing this because it was impossible to build larger LLVM exes with ld64-85.2.1 because of the branch islanding issue.

I am having problems with Apple ld linker time to time, especially when trying to build ports on 10.5.8 as universal. LLVM, even as ancient as 3.3, fails to build for ppc64 with some ranlib errors. I will have to review which specific issues I faced are tools-related. But building for ppc64 seems an immediate case.

One big thing I was trying to accomplish is make Stan work. I am yet to try new gcc10 with it. Hopefully it improves things, since with gcc7 I was able to build required libraries and even install Rstan after one of its developers made a custom version that didn't require libv8 (which fails on ppc), but model compilation failed. There is a problem with Apple ibtool on ppc, but that perhaps won't be fixed. Due to it all newer apps using Xibs in Xcode fail, starting from R GUI to Transmission.

My main interest is in improving ppc64 (I have several ppc32 machines, but they are really too slow for the modern compilers - my oldest AGP G4 takes ≈ 1 week to build and test GCC)...

Do you think it may be feasible to bring back support of ppc64 into 10A190? Porting some components from 10.5.8 (which was released after 10A190) and rebuilding from sources other. I honestly don't have an idea what is needed for the OS to build and run ppc64 apps; kernel may be 32-bit, as it is on 10.5.8 anyway.

*** one day I do hope that we can declare a "unified" set of tools that support the older platforms, but at present almost all of the volunteer time is going into the arm64 port -so you will need to be patient :)

Sure! Making gcc10 build was the best New year gift already. I will be patient. In the meanwhile, I will try fixing Python for ppc64 and build your xtools.

barracuda156 avatar Jan 02 '22 18:01 barracuda156

please could we try moving general discussion on what is possible / methods for doing things etc. to a central place - I think stuff will get lost in the issues.

here:

https://github.com/iains/darwin-toolchains-start-here/discussions

So maybe we want topics on ppc, ppc64, llvm on ppc etc.

iains avatar Jan 02 '22 20:01 iains

please could we try moving general discussion on what is possible / methods for doing things etc. to a central place - I think stuff will get lost in the issues.

here:

https://github.com/iains/darwin-toolchains-start-here/discussions

So maybe we want topics on ppc, ppc64, llvm on ppc etc.

Would be awesome, yes. I bookmarked that page, and we can move all info to there.

barracuda156 avatar Jan 02 '22 20:01 barracuda156

BUT there are still some things to do - because we have a problem with conflicts between the GCC-installed libstdc++.dylib and /usr/lib/libstdc++ (this is not specific to xtools, it's a general problem). There are ways to work around it - but those involve building the other dependencies. So - some additional work is needed (I will see what can be done - but it's not going to be quick).

@iains From what I understood, gcc11 can use libc++. Will that do away with a duplicate libstdc++ problem? Have you tested libcxx from your LLVM-7.1 repo on PPC?

P. S. Again, asking not out of curiosity: if libcxx is usable on PPC, I can try bringing your patches into Macports.

barracuda156 avatar May 26 '22 15:05 barracuda156