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

Ticket #896 (reopened defect)

Opened 10 months ago

Last modified 4 months ago

Missing or incomplete (Free)BSD support

Reported by: Ralith Assigned to: sean
Priority: major Milestone: 0.99.8
Component: Tango Version: trunk
Keywords: FreeBSD BSD gdc triage Cc:

Description

Tango (from svn up to date as of this posting) fails to build on a FreeBSD system, as a result of many instances of code which is version-specific for linux, Win32, and darwin, but has no BSD version or usable default, leading to, among other things, undeclared types, as in tango.sys.Common, and sometimes even a static assert(false), as in tango.stdc.stdio. Note that BSD-incompatible code is almost certainly not limited to these modules. In most cases, copying the darwin or linux code with little or no modification to a version(FreeBSD) (or similar) block should suffice to resolve the problem, as all three systems are internally very similar.

Attachments

cumulative.diff (39.6 kB) - added by Ralith on 05/02/08 19:14:24.
Mostly working and relative to latest SVN. Includes fully-working (although only double-accurate) math funcs. Testing, determination of issues, and fixes for them needed!

Change History

02/13/08 03:09:18 changed by larsivi

  • keywords changed from FreeBSD BSD to FreeBSD BSD gdc.
  • owner changed from kris to larsivi.
  • status changed from new to assigned.
  • priority changed from critical to major.

An alternative solution to the two attached files were added in [3174]

02/13/08 04:26:05 changed by larsivi

bash placement portability in [3176]

02/13/08 04:50:53 changed by larsivi

What is the version identifier used on FreeBSD, and if there are both BSD and FreeBSD, is BSD generally general enough to use?

02/13/08 05:52:15 changed by larsivi

Another question; which version of GDC?

02/13/08 18:38:12 changed by Ralith

I'm not deeply familiar with the other BSDs, but my guess is that they're generally compatible for most purposes relevant to tango. I'm on FreeBSD-7.0-PRERELEASE, and running the version of gdc in ports, which reports itself as: {{{gdc (GCC) 4.1.3 20071105 (prerelease (gdc 0.24, using dmd 1.020)) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.}}}

02/14/08 03:48:37 changed by Ralith

My gdc version defines version "freebsd" (note case) on my system, making "version(freebsd)" the appropriate conditional.

02/14/08 18:21:13 changed by larsivi

Preliminary support in [3187] and [3188].

02/15/08 13:59:56 changed by larsivi

(In [3191]) FreeBSD definitions, thanks Ralith. Refs #896

02/15/08 15:37:27 changed by larsivi

(In [3193]) support for freebsd, thanks Ralith, refs #896

03/07/08 19:25:36 changed by sean

I'm a bit confused about these diff files. The first few are all ads, but the last one alters stuff in the freebsd blocks and also alters things in general Tango source files. The first issue leads me to wonder if the adds were actually done based on the freebsd headers or if they were simply a copy of the linux declarations. If the latter, why was this done? As for the second issue, I'd like to believe that if freebsd stuff is defined properly in the Posix modules then no other changes should be necessary anywhere, yet I see a bunch of new freebsd-specific versioning in the Thread and Socket modules, among others.

03/08/08 18:44:26 changed by Ralith

Many of the ads were in cases where there were no 'default' declarations; without them, the relevant functions would simply not be declared on FreeBSD, and there sometimes even existed a static assert(false) that would prevent compilation from continuing without such a duplication. The edits in Thread.d are to accommodate the fact that FreeBSD's pthread cleanup funcs are actually funcs, and thus must be used as such, whereas Linux (and darwin?) used macros that were approximated using structs. The linux/darwin pthread cleanup stuff could probably be modified to provide a unified function interface that would remove the need for this, but that was significantly beyond my task. The Socket.d edits are to accommodate for minor differences in the structs used by FreeBSD vs. other systems as declared in that file. I agree that these structs should be declared elsewhere, but I opted for simply adding to what already existed, instead of reorganizing.

04/27/08 05:09:28 changed by larsivi

  • milestone changed from 0.99.6 to 0.99.7.

05/02/08 19:14:24 changed by Ralith

  • attachment cumulative.diff added.

Mostly working and relative to latest SVN. Includes fully-working (although only double-accurate) math funcs. Testing, determination of issues, and fixes for them needed!

05/03/08 15:00:34 changed by larsivi

Hmm, seems like the example hangs on Linux too - albeit not so often if I exchange Stdout with log.Trace.

05/06/08 16:32:38 changed by larsivi

Ralith; an additional thing you can do, go to lib/ and run

./unittest.sh --run-all gdc

then run the resulting runSomething binary. There should be about 60 modules/tests listed.

05/07/08 13:48:05 changed by larsivi

  • owner changed from larsivi to sean.
  • status changed from assigned to new.

Handing over to Sean as he wants to review.

05/07/08 21:52:02 changed by sean

Have you tried locking the appropriate mutex before issuing the notify?

05/11/08 17:54:15 changed by larsivi

  • keywords changed from FreeBSD BSD gdc to FreeBSD BSD gdc triage.

07/10/08 07:02:07 changed by larsivi

  • milestone changed from 0.99.7 to 0.99.8.

07/26/08 13:11:33 changed by sean

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

I'll accept patches for the C / Posix headers, but I'd prefer if they affect only those files. Please follow the example of how the code is currently formatted (version blocks per OS) and submit a patch for what you'd like added. Or simply submit text files with the additions and I can put them in. If any Tango user code is to be altered I'd prefer that be done in a separate ticket with an explanation for why it's necessary.

07/28/08 13:25:01 changed by larsivi

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

WrongProcedureException! I agree with the sentiment that C/Posix patch should be in a different ticket from any user library ticket, but we still need a !FreeBSD support ticket and I think this one should be it.

So, to move on, create a ticket for C/Posix patches, and a ticket for each of any other issues that may exist, and link those necessary for BSD support to this ticket such that this one can be closed when this support is stable'ish.

08/05/08 03:23:07 changed by Ralith

A cleaner and somewhat improved patch for the C portions of tango has been uploaded to #1225

08/06/08 02:54:59 changed by Ralith

A cleanup patch for Thread.d (arguably worth applying even without FreeBSD, to make it sync closer with tango/stdc/posix/thread.d) has been uploaded to #1227

08/06/08 03:07:13 changed by Ralith

A patch declaring needed system-specific alongside those for Linux, Darwin, and Windows has been uploaded to #1228

08/06/08 03:40:00 changed by Ralith

A patch disabling tango.math.Math.log2, which depends on a C/POSIX function unavailable on FreeBSD-STABLE, has been uploaded to #1229

08/15/08 04:02:53 changed by Ralith

#1229 closed; an implementation of log2 has been included in the second update to the patch in #1225.