Closed Bug 510657 Opened 15 years ago Closed 15 years ago

OS/2 build break in nanojit/avmplus after checkin for bug504462

Categories

(Core :: JavaScript Engine, defect)

x86
OS/2
defect
Not set
major

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: wuno, Unassigned)

References

Details

Attachments

(2 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.9.1.2) Gecko/20090802 Firefox/3.5.2 Build Identifier: E:/usr/src/hg/mozilla-central/js/src/nanojit/avmplus.cpp: In function 'void VMPI_setPageProtection(void*, size_t, bool, bool)': E:/usr/src/hg/mozilla-central/js/src/nanojit/avmplus.cpp:118: error: '_SC_PAGESIZE' was not declared in this scope E:/usr/src/hg/mozilla-central/js/src/nanojit/avmplus.cpp:118: error: 'sysconf' was not declared in this scope E:/usr/src/hg/mozilla-central/js/src/nanojit/avmplus.cpp:125: error: 'PROT_READ' was not declared in this scope E:/usr/src/hg/mozilla-central/js/src/nanojit/avmplus.cpp:127: error: 'PROT_EXEC' was not declared in this scope E:/usr/src/hg/mozilla-central/js/src/nanojit/avmplus.cpp:130: error: 'PROT_WRITE' was not declared in this scope E:/usr/src/hg/mozilla-central/js/src/nanojit/avmplus.cpp:132: error: 'mprotect' was not declared in this scope E:/usr/src/hg/mozilla-central/js/src/nanojit/avmplus.cpp: In member function 'void nanojit::CodeAlloc::freeCodeChunk(void*, size_t)': E:/usr/src/hg/mozilla-central/js/src/nanojit/avmplus.cpp:181: error: no matching function for call to 'nanojit::CodeAlloc::free(void*&)' E:/usr/src/hg/mozilla-central/js/src/nanojit/CodeAlloc.h:159: note: candidates are: void nanojit::CodeAlloc::free(nanojit::NIns*, nanojit::NIns*) A workaround for the moment is to build with --disable-jit Reproducible: Always
Blocks: 504462
Version: unspecified → Trunk
Interesting. If including mman.h solves our problem does that mean we do have a working mmap in kLibc? That would also significantly improve our chances to fix bug 510705 and bug 417450.
Attachment #394754 - Flags: review?(graydon)
No working mmap in klibc, just the headers. I've tried linking with Yuri's mmap.lib but it still crashes. I'll have to review the build log to make sure I didn't screw up
mmap is not required here, so much as "a way to get some memory we can switch the executable protection bits on". valloc() is the fallback, you might want to try that? Afraid I'm not much of an OS/2 expert, don't know what it exposes.
Comment on attachment 394754 [details] [diff] [review] trivial fixes for breakage [checked in comment 9] This is fine if it works, but I'd be surprised if it actually *does* if OS/2 lacks mmap. This will make it build, but does it run?
Attachment #394754 - Flags: review?(graydon) → review+
(In reply to comment #5) > This is fine if it works, but I'd be surprised if it actually *does* if > OS/2 lacks mmap. This will make it build, but does it run? Sure, no problems. We had to add sys/mman.h to get access to mprotect() which on OS/2 is just a thin wrapper around an OS API. valloc() also works as it should, returning page-aligned memory. However, the region of memory valloc() uses could be problematic in some circumstances. It might be safer if we substituted platform-specific code for both functions (much like the Win code).
Should we still get the trivial fix in as an intermediate solution?
Absolutely. Please assign to me if you want me to land it, otherwise any volunteer will do.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch OS/2-specific code for avmplus (obsolete) — Splinter Review
This adds platform-specific code to allocate, free, and set page protection for nanojit code chunks. My earlier patch which fixed a build breakage remains valid.
Attachment #396121 - Attachment is obsolete: true
Comment on attachment 396151 [details] [diff] [review] OS/2 code for avmplus - v2 [checked in comment 13] Looks good from an OS/2 POV, but I guess a JS person should review this. Andreas, can you do that?
Attachment #396151 - Flags: review?(gal)
Attachment #396151 - Flags: review?(gal) → review+
Great, thanks again! Pushed to mozilla-central: http://hg.mozilla.org/mozilla-central/rev/45c8ca4ab959
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
Attachment #396151 - Attachment description: OS/2 code for avmplus - v2 → OS/2 code for avmplus - v2 [checked in comment 13]
Attachment #394754 - Attachment description: trivial fixes for breakage → trivial fixes for breakage [checked in comment 9]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: