DMD builds fail on Mac OS X

RESOLVED FIXED in mozilla29



6 years ago
6 years ago


(Reporter: Ehsan, Assigned: smichaud)



Dependency tree / graph

Firefox Tracking Flags

(Not tracked)



(1 attachment)



6 years ago
4:08.25 Executing: /usr/local/bin/clang++ -Qunused-arguments -Qunused-arguments -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-mismatched-tags -Wno-error=uninitialized -Wno-error=deprecated-declarations -fcolor-diagnostics -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x -pthread -DNO_X11 -pipe -DDEBUG -D_DEBUG -DTRACING -g -fno-omit-frame-pointer -fPIC -o libdmd.dylib -Wl,-filelist,/Users/ehsan/moz/src/obj-ff-dbg-dmd.noindex/memory/replace/dmd/tmp9c_CG9.list -framework Cocoa -lobjc -framework ExceptionHandling -Wl,-executable_path,/Users/ehsan/moz/src/obj-ff-dbg-dmd.noindex/dist/bin -dynamiclib -install_name @executable_path/libdmd.dylib -compatibility_version 1 -current_version 1 -single_module
 4:08.25 /Users/ehsan/moz/src/obj-ff-dbg-dmd.noindex/memory/replace/dmd/tmp9c_CG9.list:
 4:08.25     strcpy.o
 4:08.25     HashFunctions.o
 4:08.25     nsStackWalk.o
 4:08.25     DMD.o
 4:08.25 Undefined symbols for architecture x86_64:
 4:08.25   "nsCocoaFeatures::OnLionOrLater()", referenced from:
 4:08.25       OnLionOrLater() in nsStackWalk.o
 4:08.25 ld: symbol(s) not found for architecture x86_64
 4:08.25 clang++: error: linker command failed with exit code 1 (use -v to see invocation)
 4:08.25 make[5]: *** [libdmd.dylib] Error 1
 4:08.25 make[4]: *** [memory/replace/dmd/libs] Error 2
 4:08.25 make[3]: *** [libs] Error 2
 4:08.25 make[2]: *** [default] Error 2
 4:08.25 make[1]: *** [realbuild] Error 2
 4:08.25 make: *** [build] Error 2


6 years ago
Blocks: 676907
Keywords: regression

Comment 1

6 years ago
I tried adding to the build but that opens a can of worms since that will require us to pull in a whole bunch of XPCOM code...  One alternative is to copy the code inside in nsStackWalk.cpp without the XPCOM-isms such as NS_OBJC_BEGIN_TRY_ABORT_BLOCK, etc.


6 years ago
Blocks: 884368
FWIW, I'm still on 10.7 and I don't have any problem building.

Comment 3

6 years ago
(In reply to comment #2)
> FWIW, I'm still on 10.7 and I don't have any problem building.

I'm on 10.9 in case it makes a difference.

Comment 4

6 years ago
Actually, I don't understand why this has to be a 10.9 specific issue.  Does your nsStackWalk.cpp depend on  If yes, you should experience the same problem!
Flags: needinfo?(n.nethercote)
Summary: DMD builds fail on Mac → DMD builds fail on Mac OS X 10.9

Comment 5

6 years ago
Also, are you on a debug build?  The code in question doesn't exist in opt builds.
Oh, I only tested an opt build.
Flags: needinfo?(n.nethercote)
What are DMD builds? :-)

What mozconfig option do you need to make them happen?
DMD wraps malloc and free calls with various logging stuff, roughly speaking.

There's info on how to build it here:

Comment 9

6 years ago
This is the mozconfig you need to repro this bug:

ac_add_options --enable-dmd
ac_add_options --enable-debug

And it's not 10.9 specific, sorry for the red herring.
Summary: DMD builds fail on Mac OS X 10.9 → DMD builds fail on Mac OS X
No longer blocks: 10.9-build_issues
Posted patch Simple fixSplinter Review
The problem here is that nsStackWalk.cpp, which contains a call to nsCocoaFeatures::OnLionOrLater(), is linked into both XUL and libdmd.dylib.  But while XUL also links the object code corresponding to, libdmd.dylib doesn't.

So we can't call nsCocoaFeatures::OnLionOrLater() from nsStackWalk.cpp.

We also can't just paste in the version checking code from (intAtStringIndex() and GetSystemVersion()), because that uses Objective-C syntax.  So unless we want to rewrite those methods to use CoreFoundation calls instead of Cocoa ones, we'll have to go back to using Gestalt() to get the OS X system version.

We've left lots of other calls to Gestalt() in the tree.  And (for complicated reasons) I'm reasonably certain Apple will never get rid of Gestalt(), though they've deprecated it.  So I think it's fine to also go back to using Gestalt() here.

It would be neater (and in the long run probably better) to rewrite the version checking code from to not use Objective-C syntax.  That way we could (probably) replace all the calls to Gestalt() in the tree.  But we'll *never* be able to replace all the calls to Gestalt() with calls to nsCocoaFeatures::OnLionOrLater() and friends.
Assignee: nobody → smichaud
Attachment #8357412 - Flags: review?(bgirard)
Attachment #8357412 - Flags: review?(bgirard) → review+
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.