Lucy
  1. Lucy
  2. LUCY-157

Add -pthread linker flag on OpenBSD

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.1.0 (incubating)
    • Component/s: None
    • Labels:
      None

      Description

      OpenBSD has userland pthreads, requiring the addition of the
      "-pthread" linker flag so that lazy binding does not fail.

        Activity

        Hide
        Marvin Humphrey added a comment -

        CPAN Testers failure for OpenBSD 4.9 and Perl 5.10.0:

        http://www.cpantesters.org/cpan/report/5e21bf78-943b-11e0-92a5-c348c9b7ec30

        Lucy only makes use of pthreads when no atomics library is available. It's
        the last fallback: if pthreads.h isn't there, Lucy will fail to build.

        In this case, Lucy built – so pthread.h is there – but lazy binding failed
        for the symbols pthread_mutex_lock and pthread_mutex_unlock. This seems to
        have happened because OpenBSD has userland pthreads, requiring the addition of
        the `-pthread` flag at link time.

        Lucy built and passed it's tests on other OpenBSD 4.9 boxen, but the Perls in
        question have "-pthread" in the "ldflags", which gets passed along to the
        linker via ExtUtils::CBuilder.

        http://www.cpantesters.org/cpan/report/f99b520a-9244-11e0-92a5-c348c9b7ec30

          Linker and Libraries:
            ld='cc', ldflags ='-pthread -Wl,-E  -fstack-protector -L/usr/local/lib'
            libpth=/usr/local/lib /usr/lib
        
        Show
        Marvin Humphrey added a comment - CPAN Testers failure for OpenBSD 4.9 and Perl 5.10.0: http://www.cpantesters.org/cpan/report/5e21bf78-943b-11e0-92a5-c348c9b7ec30 Lucy only makes use of pthreads when no atomics library is available. It's the last fallback: if pthreads.h isn't there, Lucy will fail to build. In this case, Lucy built – so pthread.h is there – but lazy binding failed for the symbols pthread_mutex_lock and pthread_mutex_unlock. This seems to have happened because OpenBSD has userland pthreads, requiring the addition of the `-pthread` flag at link time. Lucy built and passed it's tests on other OpenBSD 4.9 boxen, but the Perls in question have "-pthread" in the "ldflags", which gets passed along to the linker via ExtUtils::CBuilder. http://www.cpantesters.org/cpan/report/f99b520a-9244-11e0-92a5-c348c9b7ec30 Linker and Libraries: ld='cc', ldflags ='-pthread -Wl,-E -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /usr/lib
        Hide
        Marvin Humphrey added a comment -

        Using Charmonizer to check whether certain linker flags are needed would be
        better, but OpenBSD is the only place we're seeing this kind of failure right
        now and a simple patch gets the job done.

        Show
        Marvin Humphrey added a comment - Using Charmonizer to check whether certain linker flags are needed would be better, but OpenBSD is the only place we're seeing this kind of failure right now and a simple patch gets the job done.
        Hide
        Marvin Humphrey added a comment -

        Committed to trunk as r1134953, but needs to be merged into the
        0.1 branch.

        Show
        Marvin Humphrey added a comment - Committed to trunk as r1134953, but needs to be merged into the 0.1 branch.

          People

          • Assignee:
            Marvin Humphrey
            Reporter:
            Marvin Humphrey
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development