[Issue 20279] New: druntime PR #2821 causes link error for Fiber-dependent code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 7 21:04:05 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20279

          Issue ID: 20279
           Summary: druntime PR #2821 causes link error for
                    Fiber-dependent code
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: hsteoh at quickfur.ath.cx

Druntime PR #2821 (core.thread.refactor) has broken druntime for code that
needs to link with Fiber routines like core.thread.Fiber.yield:

Sample code:
------------
import core.thread : Fiber;
void main() {
        auto f = new Fiber(() {
                Fiber.yield();
        });
}

------------

Compiler output:
------------
/usr/bin/ld: test.o: in function `_Dmain':
test.d:(.text._Dmain[_Dmain]+0xb): undefined reference to
`_D4core6thread5fiber5Fiber7__ClassZ'
/usr/bin/ld: test.d:(.text._Dmain[_Dmain]+0x1e): undefined reference to
`_D4core6thread8osthread8PAGESIZEym'
/usr/bin/ld: test.d:(.text._Dmain[_Dmain]+0x35): undefined reference to
`_D4core6thread5fiber5Fiber6__ctorMFNbPFZvmmZCQBrQBpQBlQBi'
/usr/bin/ld: test.o: in function `_D4test4mainFZ9__lambda1FNbNiZv':
test.d:(.text._D4test4mainFZ9__lambda1FNbNiZv[_D4test4mainFZ9__lambda1FNbNiZv]+0x5):
undefined reference to `_D4core6thread5fiber5Fiber5yieldFNbNiZv'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
------------

Reverting to druntime commit 44d25a123616bd7f9332d67a28153286a5442f91 (the one
just before PR #2821 was merged) fixes the problem.

--


More information about the Digitalmars-d-bugs mailing list