FreeBSD has never implemented these flags for mmap() and software that uses them expecting Sun behavior is likely to be surprised. From my recent mmap error checking changes in HEAD, I know that at least openjdk7 and chromium both use MAP_NORESERVE. I'm not sure if either will gracefully handle the flag not being defined or if they will need patching. (I believe avg@ suggested openjdk probably does not and will need patching.) The patch can be found at the associated URL.
portmgr@ does exp-runs.
Take for exp-run. Only the headers / userland needs to be patched for the exp-run, no need to use a patched kernel, right?
World fails to build with the patch applied: --- all_subdir_truss --- /poudriere/jails/head-amd64-D848/usr/src/usr.bin/truss/syscalls.c:312:46: error: use of undeclared identifier 'MAP_RENAME' X(MAP_SHARED) X(MAP_PRIVATE) X(MAP_FIXED) X(MAP_RENAME) ^ /poudriere/jails/head-amd64-D848/usr/src/usr.bin/truss/syscalls.c:291:16: note: expanded from macro 'X' #define X(a) { a, #a }, ^ /poudriere/jails/head-amd64-D848/usr/src/usr.bin/truss/syscalls.c:313:4: error: use of undeclared identifier 'MAP_NORESERVE' X(MAP_NORESERVE) X(MAP_RESERVED0080) X(MAP_RESERVED0100) ^ /poudriere/jails/head-amd64-D848/usr/src/usr.bin/truss/syscalls.c:291:16: note: expanded from macro 'X' #define X(a) { a, #a }, ^
Created attachment 147741 [details] patch A patch that passes "buildworld"
I will exp-run with the patch I just attached
Exp-run results are available at: http://package18.nyi.freebsd.org/build.html?mastername=head-amd64-D848-default&build=2014-09-28_07h08m12s There were 14 new failures and around 4500 ports skipped due to those failures New failures: + {"origin"=>"devel/libunwind", "pkgname"=>"libunwind-20121006_1", "phase"=>"build", "errortype"=>"clang"} + {"origin"=>"devel/umem", "pkgname"=>"umem-1.0.1_4", "phase"=>"build", "errortype"=>"clang"} + {"origin"=>"graphics/cairo", "pkgname"=>"cairo-1.12.16_1,2", "phase"=>"build", "errortype"=>"clang"} + {"origin"=>"java/openjdk6", "pkgname"=>"openjdk6-b32,1", "phase"=>"build", "errortype"=>"clang"} + {"origin"=>"java/openjdk6-jre", "pkgname"=>"openjdk6-jre-b32,1", "phase"=>"build", "errortype"=>"clang"} + {"origin"=>"java/openjdk7", "pkgname"=>"openjdk-7.65.17,1", "phase"=>"build", "errortype"=>"clang"} + {"origin"=>"lang/ccl", "pkgname"=>"ccl-1.9", "phase"=>"build", "errortype"=>"clang"} + {"origin"=>"lang/v8", "pkgname"=>"v8-3.18.5", "phase"=>"build", "errortype"=>"clang"} + {"origin"=>"lang/v8-devel", "pkgname"=>"v8-devel-3.27.7_1", "phase"=>"build", "errortype"=>"clang"} + {"origin"=>"mail/annoyance-filter", "pkgname"=>"annoyance-filter-1.0d_2", "phase"=>"build", "errortype"=>"compiler_error"} + {"origin"=>"security/binwalk", "pkgname"=>"binwalk-0.5.0_2", "phase"=>"build", "errortype"=>"clang"} + {"origin"=>"www/node", "pkgname"=>"node-0.10.32", "phase"=>"build", "errortype"=>"clang"} + {"origin"=>"www/node-devel", "pkgname"=>"node-devel-0.11.13", "phase"=>"build", "errortype"=>"clang"} + {"origin"=>"www/trafficserver", "pkgname"=>"trafficserver-5.0.1", "phase"=>"build", "errortype"=>"clang"} Failure logs: http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/libunwind-20121006_1.log http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/umem-1.0.1_4.log http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/cairo-1.12.16_1,2.log http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/openjdk6-b32,1.log http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/openjdk6-jre-b32,1.log http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/openjdk-7.65.17,1.log http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/ccl-1.9.log http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/v8-3.18.5.log http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/v8-devel-3.27.7_1.log http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/annoyance-filter-1.0d_2.log http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/binwalk-0.5.0_2.log http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/node-0.10.32.log http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/node-devel-0.11.13.log http://package18.nyi.freebsd.org/data/head-amd64-D848-default/2014-09-28_07h08m12s/logs/errors/trafficserver-5.0.1.log
Comment on attachment 147741 [details] patch Yes, thank you for catching this.
Created attachment 148279 [details] ports patch First version of a patch for ports to remove MAP_NORESERVE usage
Please re-run this. You can use the previous world (if you still have it). I have patched the ports that failed previously in the attached patch.
Take for exp-run
Note: i will apply the patch on a 10.1 world to test ~150 more ports than on head.
This part of the port patch in java/openjdk7/files/patch-src-os-bsd-vm-os_bsd.cpp doesn't look good: -+#define DEFAULT_LIBPATH "/lib:/usr/lib:%%LOCALBASE%%/lib" ++#define DEFAULT_LIBPATH "/lib:/usr/lib:/usr/local/lib"
Oops, missed that. Due to rediffing the file after patching. I'll update the ports patch
Created attachment 148303 [details] ports patch
Exp-run results: http://package18.nyi.freebsd.org/jail.html?mastername=101amd64D848-default-PR193961 1 new failure: databases/galera Failure log: http://package18.nyi.freebsd.org/data/101amd64D848-default-PR193961/2014-10-14_19h21m00s/logs/errors/galera-25.3.5_1.log I let you fix it, and patch approved.
A commit references this bug: Author: jhb Date: Sat Oct 18 12:20:47 UTC 2014 New revision: 371117 URL: https://svnweb.freebsd.org/changeset/ports/371117 Log: The MAP_NORESERVE flag to mmap() has never been implemented in FreeBSD and is being removed. No portrev bump needed since the kernel will continue to accept this flag for old binaries even after support for it in new binaries is removed. PR: 193961 Approved by: portmgr (antoine) Changes: head/databases/galera/files/patch-galerautils-src-gu_mmap.cpp head/devel/libunwind/files/ head/devel/libunwind/files/patch-tests-mapper.c head/devel/umem/files/patch-vmem_mmap.c head/graphics/cairo/files/patch-util_cairo-sphinx_sphinx.c head/java/openjdk6/files/patch-set head/java/openjdk7/files/patch-src-os-bsd-vm-os_bsd.cpp head/java/openjdk8/files/patch-bsd head/lang/ccl/files/patch-lisp-kernel_memory.c head/lang/v8/files/patch-src_platform-freebsd.cc head/lang/v8-devel/files/patch-src_platform-freebsd.cc head/mail/annoyance-filter/files/patch-annoyance-filter.cc head/security/binwalk/files/patch-common.c head/www/chromium/files/patch-v8__src__base__platform__platform-freebsd.cc head/www/node/files/ head/www/node/files/patch-deps_v8_src_platform-freebsd.cc head/www/node-devel/files/ head/www/node-devel/files/patch-deps_v8_src_platform-freebsd.cc head/www/trafficserver/files/patch-lib__ts__Compatability.h head/www/trafficserver/files/patch-tools__jtest__jtest.cc
A commit references this bug: Author: jhb Date: Sat Oct 18 12:28:52 UTC 2014 New revision: 273250 URL: https://svnweb.freebsd.org/changeset/base/273250 Log: Retire the unimplemented MAP_RENAME and MAP_NORESERVE flags to mmap(2). Older binaries are still permitted to use these flags. PR: 193961 (exp-run in ports) Differential Revision: https://reviews.freebsd.org/D848 Reviewed by: kib Changes: head/sys/sys/mman.h head/sys/sys/param.h head/sys/vm/vm_mmap.c head/usr.bin/truss/syscalls.c
A commit references this bug: Author: madpilot Date: Tue Dec 9 14:06:59 UTC 2014 New revision: 374392 URL: https://svnweb.freebsd.org/changeset/ports/374392 Log: Fix build on recent head by removing references to the MAP_NORESERVE flag to mmap(2). It has never been implemented in FreeBSD and thus was being ignored before anyway. No functional change, so no PORTREVISION bump. PR: 193961 (related) Changes: head/games/0ad/files/patch-source_lib_allocators_page__aligned.cpp head/games/0ad/files/patch-source_lib_sysdep_os_unix_uvm.cpp