Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #593 (closed defect: fixed)

Opened 17 years ago

Last modified 15 years ago

tango.core.Atomic and -fPIC

Reported by: afb Assigned to: sean
Priority: normal Milestone: 0.99.6
Component: Core Functionality Version: trunk
Keywords: gdc, mac, osx Cc: fawzi@gmx.ch

Description

When running the unittest on Mac OS X, I get:

tango/core/Atomic.d: In function 'atomicLoad':
tango/core/Atomic.d:380: error: PIC register 'ebx' clobbered in 'asm'

-fPIC is the default on Darwin and Mac OS X.

Change History

11/12/07 10:59:23 changed by larsivi

  • keywords set to gdc, mac, osx.

01/09/08 15:50:41 changed by afb

  • status changed from new to closed.
  • resolution set to fixed.

I don't get this anymore with the new version - closing, outdated.

01/09/08 16:05:37 changed by larsivi

  • milestone changed from 1.0 to 0.99.5.

02/28/08 04:37:23 changed by jey

  • status changed from closed to reopened.
  • resolution deleted.

Hi, I am still seeing this problem with trunk r3304 on darwin/x86. When I build with dsss with all default compiler options, I get the following error:

.../include/d/tango/core/Atomic.di: In function 'atomicStore':
.../include/d/tango/core/Atomic.di:528: error: PIC register 'ebx' clobbered in 'asm'
.../include/d/tango/core/Atomic.di:530: error: PIC register 'ebx' clobbered in 'asm'

Here's a testcase exhibiting the problem:

module tester;
import tango.core.Atomic;

void test()
{
    Atomic!(bool) v;
    v.store(true);
    v.load();
}

Output of gdc -v is:

Using built-in specs.
Target: i386-apple-darwin8.11.1
Configured with: ../gcc-4.1.2/configure --prefix=/Users/jey/programming/browser/bins --enable-languages=c,d
Thread model: posix
gcc version 4.1.2 20070214 (  (gdc 0.24, using dmd 1.020))

02/28/08 09:13:06 changed by afb

Yeah, I am also seeing it.

03/04/08 09:20:59 changed by Jim Panic

  • milestone changed from 0.99.5 to 0.99.6.

04/16/08 09:08:38 changed by fawzi

  • cc set to fawzi@gmx.ch.

04/16/08 17:07:28 changed by sean

Okay... I'll add a push/pop ebx to the relevant routines.

04/17/08 05:00:13 changed by sean

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [3438]) Changed use of EBX to scratch register EDX to avoid the need to save/restore EBX in function call. This closes #593

11/27/08 17:57:56 changed by fawzi

(In [4132]) disable Has64BitCAS on darwin (due to clobbering of EBX and -fPIC) refs #1059, #593