Support of -pthread
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 796 from 2007/10/23
    From: Gelsenkirchen,...
    stackoverflow says it should work, but I get
    Code:
    > gcc -pthread foo.c
    gcc: error: unrecognized command line option '-pthread'
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »17.09.21 - 19:27
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 3031 from 2003/3/5
    From: Canada
    -lpthread
  • »17.09.21 - 19:48
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 796 from 2007/10/23
    From: Gelsenkirchen,...
    Well, it's not the same, see comments in the link.
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »17.09.21 - 21:16
    Profile
  • MorphOS Developer
    Piru
    Posts: 582 from 2003/2/24
    From: finland, the l...
    It may not be the same but our gcc clearly does not have the option.

    No amount of stackoverflow saying it is there will make it suddenly appear.

    [ Edited by Piru 18.09.2021 - 01:19 ]
  • »17.09.21 - 23:18
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 796 from 2007/10/23
    From: Gelsenkirchen,...
    Some background:
    configure is using -pthread and believes we don't support pthread.
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »18.09.21 - 22:41
    Profile
  • MorphOS Developer
    Piru
    Posts: 582 from 2003/2/24
    From: finland, the l...
    Quote:

    polluks wrote:
    Some background:
    configure is using -pthread and believes we don't support pthread.

    You'll need to coax the configure script to co-operate then (making it ignore the error), and use -lpthread during linking.

    It is a bit silly to require -pthread to begin with. It'll break on other platforms as well.

    [ Edited by Piru 19.09.2021 - 02:01 ]
  • »19.09.21 - 00:00
    Profile
  • MorphOS Developer
    Piru
    Posts: 582 from 2003/2/24
    From: finland, the l...
    I've managed to add this option now and it likely will be included in the future SDK releases.

    However, unlike with other platforms -pthread will not automagically make the compilation to pick multithreading-safe libc functions (while some functions are thread safe, others are not). So depending on what the application assumes about multithreading safety, bad things might happen.

    Basically it just links the application with -lpthread.

    This is far from perfect.
  • »19.09.21 - 01:11
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 796 from 2007/10/23
    From: Gelsenkirchen,...
    @Piru
    Indeed, it was a little bit weird, having a new gcc but missing an option (not talking about -m64 of course).
    Thank you very much anyway!
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »19.09.21 - 01:40
    Profile
  • MorphOS Developer
    Piru
    Posts: 582 from 2003/2/24
    From: finland, the l...
    Quote:

    polluks wrote:
    @Piru
    Indeed, it was a little bit weird, having a new gcc but missing an option (not talking about -m64 of course).


    It's not a standard gcc option, but platform specific one. That's why it was missing.
  • »19.09.21 - 01:59
    Profile