Closed Bug 987888 Opened 10 years ago Closed 10 years ago

--enable-content-sandbox breaks 64-bit builds

Categories

(Core :: Security, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: TimAbraldes, Assigned: m_kato)

References

Details

Attachments

(1 file)

On VC++ Express 2010, Windows 8.1, when building a 64-bit Firefox with --enable-content-sandbox, the following errors are encountered:

 7:12.32 c:\src\mc3\security\sandbox\chromium\base/basictypes.h(326) : error C2118: negative subscript
 7:12.32         c:/src/mc3/security/sandbox/win/src/service_resolver_32.cc(203) : see reference to function template instantiation 'Dest bit_cast<const void*,ULONG>(const Source &)' being compiled
 7:12.32         with
 7:12.32         [
 7:12.32             Dest=const void *,
 7:12.32             Source=ULONG
 7:12.32         ]
 7:12.33 c:\src\mc3\security\sandbox\chromium\base/basictypes.h(326) : error C2118: negative subscript
 7:12.33         c:/src/mc3/security/sandbox/win/src/service_resolver_32.cc(214) : see reference to function template instantiation 'Dest bit_cast<const wchar_t*,DWORD>(const Source &)' being compiled
 7:12.33         with
 7:12.33         [
 7:12.33             Dest=const wchar_t *,
 7:12.33             Source=DWORD
 7:12.33         ]
 7:12.33 c:\src\mc3\security\sandbox\chromium\base/basictypes.h(326) : error C2118: negative subscript
 7:12.33         c:/src/mc3/security/sandbox/win/src/service_resolver_32.cc(254) : see reference to function template instantiation 'Dest bit_cast<ULONG,int*>(const Source &)' being compiled
 7:12.33         with
 7:12.33         [
 7:12.33             Dest=ULONG,
 7:12.33             Source=int *
 7:12.33         ]
 7:12.33 c:\src\mc3\security\sandbox\chromium\base/basictypes.h(326) : error C2118: negative subscript
 7:12.33         c:/src/mc3/security/sandbox/win/src/service_resolver_32.cc(310) : see reference to function template instantiation 'Dest bit_cast<ULONG,void*>(const Source &)' being compiled
 7:12.34         with
 7:12.34         [
 7:12.34             Dest=ULONG,
 7:12.34             Source=void *
 7:12.34         ]
 7:12.34
 7:12.36 In the directory  /c/src/mc3/obj/security/sandbox
 7:12.36 The following command failed to execute properly:
 7:12.36 c:/src/mc3/obj/_virtualenv/Scripts/python.exe -m mozbuild.action.cl cl -Foservice_resolver_32.obj -c -DUNICODE -D_UNICODE -DNS_NO_XPCOM -DSANDBOX_EXPORTS -DNOMINMAX -D_CRT_RAND_S -DCHROMIUM_SANDBOX_BUILD -DNO_NSPR_10_SUPPORT -Ic:/s
rc/mc3/security/sandbox -I. -Ic:/src/mc3/security/sandbox/chromium/base/shim -Ic:/src/mc3/security/sandbox/chromium -Ic:/src/mc3/security -Ic:/src/mc3/nsprpub -I../../dist/include -Ic:/src/mc3/obj/dist/include/nspr -Ic:/src/mc3/obj/dist/include/nss -I/c/src/mc3/obj/dist/include -I/c/src/mc3/modules/zlib/src -MD -FI ../../dist/include/mozilla-config.h -DMOZILLA_CLIENT -wd4099 -TP -nologo -W3 -Gy -Fdgenerated.pdb -wd4251 -wd4244 -wd4345 -wd4351 -wd4482 -wd4800 -wd4819 -we4553 -GR- -DNDEBUG -DTRIMMED -Zi -UDEBUG -DNDEBUG -Oy- c:/src/mc3/security/sandbox/win/src/service_resolver_32.cc
 7:12.37 c:/src/mc3/config/rules.mk:1001: recipe for target 'service_resolver_32
.obj' failed
 7:12.37 mozmake.EXE[5]: *** [service_resolver_32.obj] Error 1


The file that is complaining (security/sandbox/win/src/service_resolver_32.cc) should not be built in a 64-bit build of Firefox. Instead we should be building service_resolver_64.cc. There are probably a bunch of other cases where we are building the 32-bit version of a file when we should be building the 64-bit version.
Attached patch for x64Splinter Review
compiling x64 files if target is x64.
Assignee: nobody → m_kato
Attachment #8396944 - Flags: review?(dkeeler)
Comment on attachment 8396944 [details] [diff] [review]
for x64

Review of attachment 8396944 [details] [diff] [review]:
-----------------------------------------------------------------

This seems reasonable. Maybe have a build peer do a quick check for style?
Attachment #8396944 - Flags: review?(dkeeler) → review+
Component: Build Config → Security
Product: Firefox → Core
Comment on attachment 8396944 [details] [diff] [review]
for x64

request by comment #2.
Attachment #8396944 - Flags: review?(mshal)
Attachment #8396944 - Flags: review?(mshal) → review+
I've tested this patch by the way and it seems to work great: With this patch applied I'm able to build 64-bit Firefox with --enable-content-sandbox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: