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

Ticket #845 (closed defect: fixed)

Opened 13 years ago

Last modified 13 years ago

Tango on linux/x86_64 doesn't compile

Reported by: Anders Assigned to: sean
Priority: major Milestone: 0.99.5
Component: Core Functionality Version: 0.99.4 Frank
Keywords: x86_64 amd64 Cc:

Description

With GDC 0.25 (a recent SVN revision) and GCC 4.1.3 (snapshot from 24th December) Tango doesn't compile on 64-bit Linux. It probably wouldn't work with 0.24 and 4.1.2 either. (Note: Phobos compiles and works)

Here's what stopped the compilation, while many of these may be small fixes others aren't so obvious:

warning - gcx.d:319: Error: implicit conversion of expression ((p - *(pool + 0LU)) / 1L / 16L) of type long to uint can cause loss of data
warning - gcx.d:516: Error: implicit conversion of expression ((p - *(pool + 0LU)) / 1L / 16L) of type long to uint can cause loss of data
warning - gcx.d:644: Error: implicit conversion of expression (cast(ulong)pagenum + newsz) of type ulong to uint can cause loss of data
warning - gcx.d:644: Error: implicit conversion of expression (psz - newsz) of type ulong to uint can cause loss of data
warning - gcx.d:663: Error: implicit conversion of expression (cast(ulong)pagenum + newsz - cast(ulong)*(pool + 100LU)) of type ulong to uint can cause loss of data
warning - gcx.d:776: Error: implicit conversion of expression (minsz - sz) of type ulong to uint can cause loss of data
warning - gcx.d:830: Error: implicit conversion of expression ((p - *(pool + 0LU)) / 1L / 4096L) of type long to uint can cause loss of data
warning - gcx.d:1614: Error: implicit conversion of expression (offset / 4096LU) of type ulong to uint can cause loss of data
warning - gcx.d:1688: Error: implicit conversion of expression (offset / 4096LU) of type ulong to uint can cause loss of data
warning - gcx.d:1734: Error: implicit conversion of expression (offset / 16LU) of type ulong to uint can cause loss of data
warning - gcx.d:1800: Error: implicit conversion of expression ((size + 4096LU - 1LU) / 4096LU) of type ulong to uint can cause loss of data
warning - gcx.d:1824: Error: implicit conversion of expression ((this.fullcollectshell)()) of type ulong to uint can cause loss of data
warning - gcx.d:2007: Error: implicit conversion of expression (offset / 4096LU) of type ulong to uint can cause loss of data
warning - gcx.d:2015: Error: implicit conversion of expression ((offset & cast(ulong)(notbinsize[cast(ulong)bin])) >> 4) of type ulong to uint can cause loss of data
warning - gcx.d:2205: Error: implicit conversion of expression ((o - *(pool + 0LU)) / 1L / 4096L) of type long to uint can cause loss of data
warning - gcx.d:2641: Error: implicit conversion of expression (poolsize / 16LU) of type ulong to uint can cause loss of data
warning - gcx.d:2642: Error: implicit conversion of expression (poolsize / 16LU) of type ulong to uint can cause loss of data
warning - gcx.d:2643: Error: implicit conversion of expression (poolsize / 16LU) of type ulong to uint can cause loss of data
warning - gcx.d:2644: Error: implicit conversion of expression (poolsize / 16LU) of type ulong to uint can cause loss of data

Change History

01/03/08 12:28:33 changed by Anders

  • summary changed from Tango on linux/x86_64 doesn't compile (gcx.d) to Tango on linux/x86_64 doesn't compile.

Another warning/error:

warning - core/Thread.d:2311: Error: implicit conversion of expression (sysconf(30)) of type long to ulong can cause loss of data

01/03/08 12:39:47 changed by larsivi

  • milestone set to 0.99.5.

For reference, this is a x86_64 install without 32 bit compat libs. Thus -m32 must be changed to -m64.

The warnings are probably due to certain types being 64 bit instead of 32 bit (which they probably are on socalled bi-arched 64 bit installs (most likely most, if not all, of 64 bit tango installs has been on such bi-arched machines)).

Probably time to sift through GDC phobos/internal sources again for more merge material.

01/07/08 20:53:05 changed by sean

  • status changed from new to assigned.

01/07/08 22:31:27 changed by sean

I changed some of the uint types to size_t within the GC ages ago. The issue simply wasn't seen until now because the GC code wasn't built with warnings enabled until the latest release. The proper fix is probably to add casting where appropriate, since the values left as uint weren't sizes, and it appears that mixed-mode calculations are being performed.

01/07/08 22:34:34 changed by sean

(In [3074]) Partial fix for #845. This refs #845.

01/08/08 19:21:04 changed by sean

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

(In [3076]) I have changed quite a few occurrences of uint to size_t where the value represented a size or length. This should address the GDC/amd64 build issues, but I haven't tested in this config to verify that all errors have been fixed. Still, I am marking the ticket as closed. Please reopen if further errors exist. This closes #845.

01/08/08 21:42:03 changed by Anders

  • status changed from closed to reopened.
  • resolution deleted.
gdmd -c -release -O -inline -w -nofloat -version=Posix -q,-nostdinc -I/home/anders/tango/lib/common -I/home/anders/tango/lib/.. -I/home/anders/tango/lib/compiler/gdc gcx.d -ofgcx.o
warning - gcx.d:1979: Error: implicit conversion of expression (newnpools) of type ulong to uint can cause loss of data
warning - gcx.d:2255: Error: implicit conversion of expression ((o - *(pool + 0LU)) / 1L / 4096L) of type long to ulong can cause loss of data
warning - gcx.d:2784: Error: implicit conversion of expression (i - n + 1LU) of type ulong to uint can cause loss of data
warning - gcx.d:2818: Error: implicit conversion of expression (i) of type ulong to uint can cause loss of data
make[1]: *** [gcx.o] Error 1

I removed -m32 from all the Makefiles I could find (it should probably be removed. I don't see the point of it, and it mucks up x86_64)

01/09/08 02:04:38 changed by sean

(In [3078]) * Changed how -m32 is set so the lib will build on 64-bit GDC. * Fixed a few remaining conversion issues. This change refs #845.

01/15/08 02:05:13 changed by sean

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

It sounds like Tango builds on x86-64 now so I'm closing this ticket.