Ticket #4996 (closed bug: wontfix)

Opened 2 years ago

Last modified 2 years ago

can't link executables due to dtrace error on Mac OS X 10.5

Reported by: MtnViewMark Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.0.2
Keywords: dtrace osx mac 10.5 Cc: pho@…
Operating System: MacOS X Architecture: Unknown/Multiple
Type of failure: GHC doesn't work at all Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo) (diff)

When building an executable on 10.5, the link step fails. Problem occurs with 7.0.2 i386 and x86_64 builds of 7.0.2 on Mac OS X 10.5. Same compilers work find on 10.6.

Example log from building HsColour:

Linking dist/build/HsColour/HsColour ...
error: Could not compile reconstructed dtrace script:

Unhandled typedefs encoding version v2
provider HaskellEvent {
	probe startup(EventCapNo);
	probe gc__work(EventCapNo);
	probe gc(int, double, long,...)(EventCapNo);
	probe gc__done(EventCapNo);
	probe thread_wakeup(EventCapNo,EventThreadID,EventCapNo);
	probe thread__runnable(EventCapNo,EventThreadID);
	probe migrate__thread(EventCapNo,EventThreadID,EventCapNo);
	probe create__thread(EventCapNo,EventThreadID);
	probe gc__start(EventCapNo);
	probe gc__end(EventCapNo);
	probe stop__thread(EventCapNo,EventThreadID,EventThreadStatus);
	probe run__thread(EventCapNo,EventThreadID);
	probe user__msg(EventCapNo,char *);
};

#pragma D attributes PRIVATE/PRIVATE/UNKNOWN provider HaskellEvent provider
#pragma D attributes PRIVATE/PRIVATE/UNKNOWN provider HaskellEvent module
#pragma D attributes PRIVATE/PRIVATE/UNKNOWN provider HaskellEvent function
#pragma D attributes PRIVATE/PRIVATE/UNKNOWN provider HaskellEvent name
#pragma D attributes PRIVATE/PRIVATE/UNKNOWN provider HaskellEvent args


ld: error creating dtrace DOF section
collect2: ld returned 1 exit status
cabal: Error: some packages failed to install:
hscolour-1.17 failed during the building phase. The exception was:
ExitFailure 1

Change History

  Changed 2 years ago by igloo

  • description modified (diff)

  Changed 2 years ago by igloo

  • description modified (diff)

follow-up: ↓ 6   Changed 2 years ago by igloo

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

Thanks for the report.

Unfortunately, we are no longer able to actively support OS X 10.5.

However, if you build GHC yourself on 10.5 then I believe it will work fine, and we will happily accept a patch to make builds made on 10.6 also work on 10.5.

  Changed 2 years ago by PHO

  • cc pho@… added

  Changed 2 years ago by grddev

The problem seems to be that the dtrace symbols use version "v2" to encode the typedefs under 10.6, which the dtrace utilities in 10.5 do not understand. According to Apples own sources ( http://www.opensource.apple.com/source/dtrace/dtrace-78/libdtrace/dt_ld.m?txt) "v2" seems to be a subset of "v1", which 10.5 understands. Comparing against an older version of ghc, the dtrace symbols indeed seem to be defined identically, but with "v1" in the name instead of "v2".

Workaround hack: Replace every instance of instance of ___dtrace_typedefs$HaskellEvent$v2$ with ___dtrace_typedefs$HaskellEvent$v1$ in the installed libHSrts*.a files. With this hack, the 10.6 build of ghc now works on 10.5 and produces working applications. What impact this change has on using dtrace together with either ghc or a resulting application, I have no idea. I also don't know how to test that. If it still works, the workaround could be integrated in the build system by simply changing the header file generated by dtrace, instead of modifying the archive files afterwards.

in reply to: ↑ 3   Changed 2 years ago by igloo

Replying to igloo:

we will happily accept a patch to make builds made on 10.6 also work on 10.5.

Actually, this won't be possible, as to support XCode 4 we have to drop support for 10.5 anyway: #5011

Note: See TracTickets for help on using tickets.