Bug 803862 - Port |Bug 722933 - add -MACHINE option for link.exe| to comm-central r=Callek
authorIan Neal <iann_cvs@blueyonder.co.uk>
Sun, 28 Oct 2012 23:01:35 +0000
changeset 14131 f5d1ecdb30d6e6f0838dbfc2e617b31d4f899d19
parent 14130 3018691b7e501610406248fcbaa53c10e9bd711a
child 14132 edf5ed0b0b7d7fdd407cbe7e05934b7f7395c2cb
push id804
push userbugzilla@standard8.plus.com
push dateMon, 07 Jan 2013 21:31:35 +0000
treeherdercomm-beta@9fdc5c67cdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCallek
bugs803862, 722933
Bug 803862 - Port |Bug 722933 - add -MACHINE option for link.exe| to comm-central r=Callek
config/rules.mk
configure.in
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -917,17 +917,17 @@ ifeq ($(OS_ARCH),BeOS)
 ifdef BEOS_PROGRAM_RESOURCE
 	xres -o $@ $(BEOS_PROGRAM_RESOURCE)
 	mimeset $@
 endif
 endif # BeOS
 
 $(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
 ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
-	$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
+	$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
 		if test -f "$(srcdir)/$@.manifest"; then \
 			echo "Embedding manifest from $(srcdir)/$@.manifest and $@.manifest"; \
 			mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
 		else \
 			echo "Embedding manifest from $@.manifest"; \
 			mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
--- a/configure.in
+++ b/configure.in
@@ -1480,17 +1480,25 @@ case "$host" in
     HOST_BIN_SUFFIX=.exe
     case "$host" in
     *mingw*)
         PERL="/bin/sh ${_topsrcdir}/mozilla/build/msys-perl-wrapper"
         ;;
     esac
 
     case "${host_cpu}" in
+    i*86)
+        if test -n "$_WIN32_MSVC"; then
+            HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
+        fi
+        ;;
     x86_64)
+        if test -n "$_WIN32_MSVC"; then
+            HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
+        fi
         HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
         ;;
     esac
     ;;
 
 *-darwin*)
     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
     HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
@@ -1979,27 +1987,31 @@ ia64*-hpux*)
             LDFLAGS="$LDFLAGS -SAFESEH"
         fi
 
         if test -n "$GNU_CC"; then
             CFLAGS="$CFLAGS -mstackrealign -fno-keep-inline-dllexport"
             CXXFLAGS="$CXXFLAGS -mstackrealign -fno-keep-inline-dllexport"
         else
             AC_DEFINE(HAVE_STDCALL)
+            DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
         fi
 
     	AC_DEFINE(_X86_)
 	;;
     alpha-*)
     	AC_DEFINE(_ALPHA_)
 	;;
     mips-*)
     	AC_DEFINE(_MIPS_)
 	;;
     x86_64-*)
+        if test -n "$_WIN32_MSVC"; then
+            DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
+        fi
     	AC_DEFINE(_AMD64_)
 	;;
     *)
     	AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
 	;;
     esac
 
     if test "$HAVE_64BIT_OS"; then