[Issue 12238] New: Using pthread_mutex_t.init results in an undefined reference linker error.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 24 00:13:29 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12238

           Summary: Using pthread_mutex_t.init results in an undefined
                    reference linker error.
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: opantm2+dbugs at gmail.com


--- Comment #0 from Kapps <opantm2+dbugs at gmail.com> 2014-02-24 00:13:24 PST ---
Sample:
import core.sys.posix.pthread;
void main() {
    auto a = pthread_mutex_t.init;
}

Output:
rdmd test.d
test.o: In function `_Dmain':
test.d:(.text._Dmain+0xa): undefined reference to
`_D4core3sys5posix3sys5types15pthread_mutex_t6__initZ'
collect2: error: ld returned 1 exit status

While this particular sample is Posix only (tested on Linux 64-bit and OSX
64-bit), I would assume that the actual bug is not OS related. The bug also
occurs with -allinst.

I wasn't able to duplicate the bug when I replaced pthread_mutex_t (either in
the same file as the test or in a different file) with:
union pthread_mutex_t {
    byte __size[40];
    ptrdiff_t __align;
}
Which should be essentially the same on my system.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list