Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#8891 closed enhancement (invalid)

c++flag -pthread unsupported

Reported by: cipri Owned by: nobody
Priority: normal Milestone: R1
Component: System/POSIX Version: R1/alpha3
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

gcc on haiku doesnt recognize the flag -pthread . As far as i was reading -pthread is normally (depending on the OS) equal: to -D_REENTRANT -lpthread

Change History (4)

comment:1 by umccullough, 7 years ago

Type: bugenhancement

At the very least, this is an enhancement request... And are you sure this is actually a POSIX requirement?

Also, there's no -lpthread support on haiku because pthread is in libroot (and AFAIK, POSIX doesn't define what lib it must reside in).

in reply to:  1 comment:2 by anevilyak, 7 years ago

Resolution: invalid
Status: newclosed

Replying to umccullough:

At the very least, this is an enhancement request... And are you sure this is actually a POSIX requirement?

It's not. Also, _REENTRANT has no meaning on Haiku.

Also, there's no -lpthread support on haiku because pthread is in libroot (and AFAIK, POSIX doesn't define what lib it must reside in).

Correct.

comment:3 by umccullough, 7 years ago

As a note - any time you run into a makefile using -pthread, or -lpthread, they should be modified to conditionally check this. When a configure script detects pthread support in a header, it should not assume that -pthread or -lpthread should be used in the compiler/link options.

Same for -lm btw - which is another common issue when dealing with ports.

comment:4 by cipri, 7 years ago

ok, so i replace -lpthread with -lroot. Is there any option that i need to add, to ensure thread safety?

Note: See TracTickets for help on using tickets.