• Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    eliot
    Posts: 516 from 2004/4/15
    Hi,

    the setup looks quiet well:
    Code:

    andre@drax:~/tmp/test_mos$ /gg/bin/ppc-morphos-g++ --version
    ppc-morphos-g++ (GCC/MorphOS) 9.2.0
    Copyright (C) 2019 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    andre@drax:~/tmp/test_mos$ /gg/bin/ppc-morphos-g++ -v
    Using built-in specs.
    COLLECT_GCC=/gg/bin/ppc-morphos-g++
    COLLECT_LTO_WRAPPER=/gg/lib/gcc-lib/ppc-morphos/9.2.0/lto-wrapper
    Target: ppc-morphos
    Configured with: ../gcc-9.2.0/configure --target=ppc-morphos --with-plugin-ld=no --enable-languages=c,c++,objc,obj-c++ --prefix=/gg --with-sysroot=/gg --libexecdir=/gg/lib --oldincludedir=/gg/include --program-prefix=ppc-morphos- --program-suffix=-9 --enable-threads=posix --disable-bootstrap --with-pkgversion=GCC/MorphOS --with-bugurl=http://www.morphos-team.net/ --enable-version-specific-runtime-libs
    Thread model: posix
    gcc version 9.2.0 (GCC/MorphOS)



    But I cannot compile/link a simple hello world example.
    Calling
    /gg/bin/ppc-morphos-g++ hello.cpp -o hello -noixemul -O3 -std=c++11

    leads to an linker error because it misses pthread_mutex_unlock and other pthread stuff.
    Are any more env variables|parameters to be set?

    EDIT:
    Complete error message:
    Code:

    andre@drax:~/tmp/test_mos$ /gg/bin/ppc-morphos-g++ hello.cpp -o hello -noixemul -O3 -std=c++11
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libstdc++.a(locale.o): in function `std::locale::_Impl::_M_install_cache(std::locale::facet const*, unsigned int)':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/src/c++98/../../../../../../gcc-9.2.0/libstdc++-v3/src/c++98/locale.cc:433: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/src/c++98/../../../../../../gcc-9.2.0/libstdc++-v3/src/c++98/locale.cc:433: undefined reference to `pthread_once'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libstdc++.a(locale.o): in function `std::locale::_Impl::_M_install_cache(std::locale::facet const*, unsigned int)':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:749: undefined reference to `pthread_mutex_lock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:779: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libstdc++.a(locale_init.o): in function `std::locale::global(std::locale const&)':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/src/c++98/../../../../../../gcc-9.2.0/libstdc++-v3/src/c++98/locale_init.cc:284: undefined reference to `pthread_once'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/src/c++98/../../../../../../gcc-9.2.0/libstdc++-v3/src/c++98/locale_init.cc:286: undefined reference to `pthread_mutex_lock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libstdc++.a(locale_init.o): in function `std::locale::global(std::locale const&)':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/bits/basic_string.h:6177: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libstdc++.a(locale_init.o): in function `std::locale::global(std::locale const&)':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:749: undefined reference to `pthread_mutex_lock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:779: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libstdc++.a(eh_alloc.o): in function `_GLOBAL__sub_I__ZN9__gnu_cxx9__freeresEv':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/libsupc++/../../../../../gcc-9.2.0/libstdc++-v3/libsupc++/eh_alloc.cc:338: undefined reference to `pthread_mutex_lock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/libsupc++/../../../../../gcc-9.2.0/libstdc++-v3/libsupc++/eh_alloc.cc:129: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/libsupc++/../../../../../gcc-9.2.0/libstdc++-v3/libsupc++/eh_alloc.cc:338: undefined reference to `pthread_mutex_lock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/libsupc++/../../../../../gcc-9.2.0/libstdc++-v3/libsupc++/eh_alloc.cc:129: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libstdc++.a(eh_globals.o): in function `_GLOBAL__sub_D___cxa_get_globals_fast':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/libsupc++/../../../../../gcc-9.2.0/libstdc++-v3/libsupc++/eh_globals.cc:145: undefined reference to `pthread_getspecific'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/libsupc++/../../../../../gcc-9.2.0/libstdc++-v3/libsupc++/eh_globals.cc:145: undefined reference to `pthread_getspecific'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/libsupc++/../../../../../gcc-9.2.0/libstdc++-v3/libsupc++/eh_globals.cc:145: undefined reference to `pthread_setspecific'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/libsupc++/../../../../../gcc-9.2.0/libstdc++-v3/libsupc++/eh_globals.cc:145: undefined reference to `pthread_key_create'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libstdc++.a(eh_globals.o): in function `_GLOBAL__sub_D___cxa_get_globals_fast':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:714: undefined reference to `pthread_key_delete'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libstdc++.a(guard.o): in function `__cxa_guard_release':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/libsupc++/../../../../../gcc-9.2.0/libstdc++-v3/libsupc++/guard.cc:389: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/libsupc++/../../../../../gcc-9.2.0/libstdc++-v3/libsupc++/guard.cc:426: undefined reference to `pthread_once'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/libsupc++/../../../../../gcc-9.2.0/libstdc++-v3/libsupc++/guard.cc:426: undefined reference to `pthread_mutex_lock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libstdc++.a(guard.o): in function `__cxa_guard_release':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ext/concurrence.h:103: undefined reference to `pthread_once'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ext/concurrence.h:103: undefined reference to `pthread_once'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ext/concurrence.h:283: undefined reference to `pthread_cond_wait'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ext/concurrence.h:283: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libstdc++.a(guard.o): in function `__cxa_guard_release':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:700: undefined reference to `pthread_once'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:749: undefined reference to `pthread_mutex_lock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:700: undefined reference to `pthread_once'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:700: undefined reference to `pthread_cond_broadcast'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libstdc++.a(guard.o): in function `__cxa_guard_release':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ext/concurrence.h:282: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libstdc++.a(guard.o): in function `__cxa_guard_release':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:700: undefined reference to `pthread_once'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:749: undefined reference to `pthread_mutex_lock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:700: undefined reference to `pthread_once'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:853: undefined reference to `pthread_cond_broadcast'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libstdc++-v3/include/ppc-morphos/bits/gthr-default.h:779: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libgcc.a(unwind-dw2.o): in function `uw_init_context_1':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libgcc/./gthr-default.h:700: undefined reference to `pthread_once'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libgcc.a(unwind-dw2-fde.o): in function `__register_frame_info.part.0':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libgcc/./gthr-default.h:749: undefined reference to `pthread_mutex_lock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libgcc/./gthr-default.h:779: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libgcc.a(unwind-dw2-fde.o): in function `__register_frame_info_bases':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libgcc/./gthr-default.h:749: undefined reference to `pthread_mutex_lock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libgcc/./gthr-default.h:779: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libgcc.a(unwind-dw2-fde.o): in function `__register_frame_info_table_bases':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libgcc/./gthr-default.h:749: undefined reference to `pthread_mutex_lock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libgcc/./gthr-default.h:779: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libgcc.a(unwind-dw2-fde.o): in function `__deregister_frame_info_bases':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libgcc/./gthr-default.h:749: undefined reference to `pthread_mutex_lock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libgcc/./gthr-default.h:779: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libgcc/./gthr-default.h:779: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /gg/lib/gcc-lib/ppc-morphos/9.2.0/libnix/libgcc.a(unwind-dw2-fde.o): in function `_Unwind_Find_FDE':
    /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libgcc/./gthr-default.h:749: undefined reference to `pthread_mutex_lock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libgcc/./gthr-default.h:779: undefined reference to `pthread_mutex_unlock'
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: /tmp/tmp.FhmnUA3YJF/gcc9/build/ppc-morphos/libnix/libgcc/./gthr-default.h:779: undefined reference to `pthread_mutex_unlock'
    collect2: error: ld returned 1 exit status



    EDIT2:
    Linking pthread does not help either:
    Code:

    andre@drax:~/tmp/test_mos$ /gg/bin/ppc-morphos-g++ hello.cpp -O3 -std=c++11 -lpthread
    /gg/lib/gcc-lib/ppc-morphos/9.2.0/../../../../ppc-morphos/bin/ld: cannot find -lpthread
    collect2: error: ld returned 1 exit status



    [ Edited by eliot 26.10.2019 - 10:40 ]
    regards
    eliot
  • »26.10.19 - 10:35
    Profile