aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
commit98e0ffaefb0f241cda3a72395d3be04192ae0d47 (patch)
tree55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /lib
parentb17ff922d4072ae132ece458f5b5d74a236880ac (diff)
parente81032ad243db32b8fd615b2d55ee94b9f6a5b6a (diff)
downloadsrc-98e0ffaefb0f241cda3a72395d3be04192ae0d47.tar.gz
src-98e0ffaefb0f241cda3a72395d3be04192ae0d47.zip
Merge sync of head
Notes
Notes: svn path=/projects/bmake/; revision=283595
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile60
-rw-r--r--lib/atf/libatf-c++/Makefile5
-rw-r--r--lib/atf/libatf-c++/Makefile.depend7
-rw-r--r--lib/clang/Makefile28
-rw-r--r--lib/clang/clang.build.mk54
-rw-r--r--lib/clang/include/AArch64GenAsmMatcher.inc2
-rw-r--r--lib/clang/include/AArch64GenAsmWriter.inc2
-rw-r--r--lib/clang/include/AArch64GenAsmWriter1.inc2
-rw-r--r--lib/clang/include/AArch64GenCallingConv.inc2
-rw-r--r--lib/clang/include/AArch64GenDAGISel.inc2
-rw-r--r--lib/clang/include/AArch64GenDisassemblerTables.inc2
-rw-r--r--lib/clang/include/AArch64GenFastISel.inc2
-rw-r--r--lib/clang/include/AArch64GenInstrInfo.inc2
-rw-r--r--lib/clang/include/AArch64GenMCCodeEmitter.inc2
-rw-r--r--lib/clang/include/AArch64GenMCPseudoLowering.inc2
-rw-r--r--lib/clang/include/AArch64GenRegisterInfo.inc2
-rw-r--r--lib/clang/include/AArch64GenSubtargetInfo.inc2
-rw-r--r--lib/clang/include/Makefile15
-rw-r--r--lib/clang/include/MipsGenFastISel.inc2
-rw-r--r--lib/clang/include/PPCGenDisassemblerTables.inc2
-rw-r--r--lib/clang/include/clang/AST/AttrVisitor.inc2
-rw-r--r--lib/clang/include/clang/Basic/AttrHasAttributeImpl.inc2
-rw-r--r--lib/clang/include/clang/Basic/Version.inc10
-rw-r--r--lib/clang/include/clang/Config/config.h23
-rw-r--r--lib/clang/include/clang/Driver/CC1AsOptions.inc2
-rw-r--r--lib/clang/include/clang/Lex/AttrSpellings.inc2
-rw-r--r--lib/clang/include/clang/Parse/AttrIdentifierArg.inc2
-rw-r--r--lib/clang/include/clang/Parse/AttrLateParsed.inc2
-rw-r--r--lib/clang/include/clang/Parse/AttrParserStringSwitches.inc2
-rw-r--r--lib/clang/include/clang/Parse/AttrTypeArg.inc2
-rw-r--r--lib/clang/include/llvm/Config/AsmParsers.def1
-rw-r--r--lib/clang/include/llvm/Config/AsmPrinters.def1
-rw-r--r--lib/clang/include/llvm/Config/Disassemblers.def2
-rw-r--r--lib/clang/include/llvm/Config/Targets.def1
-rw-r--r--lib/clang/include/llvm/Config/config.h156
-rw-r--r--lib/clang/include/llvm/Config/llvm-config.h49
-rw-r--r--lib/clang/include/llvm/Support/DataTypes.h72
-rw-r--r--lib/clang/libclanganalysis/Makefile5
-rw-r--r--lib/clang/libclangarcmigrate/Makefile1
-rw-r--r--lib/clang/libclangast/Makefile3
-rw-r--r--lib/clang/libclangbasic/Makefile12
-rw-r--r--lib/clang/libclangcodegen/Makefile10
-rw-r--r--lib/clang/libclangdriver/Makefile10
-rw-r--r--lib/clang/libclangfrontend/Makefile7
-rw-r--r--lib/clang/libclangfrontendtool/Makefile7
-rw-r--r--lib/clang/libclanglex/Makefile2
-rw-r--r--lib/clang/libclangparse/Makefile7
-rw-r--r--lib/clang/libclangrewrite/Makefile (renamed from lib/clang/libclangrewritecore/Makefile)4
-rw-r--r--lib/clang/libclangrewrite/Makefile.depend (renamed from lib/clang/libclangrewritecore/Makefile.depend)4
-rw-r--r--lib/clang/libclangrewritefrontend/Makefile4
-rw-r--r--lib/clang/libclangsema/Makefile3
-rw-r--r--lib/clang/libclangstaticanalyzercheckers/Makefile3
-rw-r--r--lib/clang/libclangstaticanalyzerfrontend/Makefile6
-rw-r--r--lib/clang/liblldb/Makefile4
-rw-r--r--lib/clang/liblldbAPI/Makefile9
-rw-r--r--lib/clang/liblldbBreakpoint/Makefile4
-rw-r--r--lib/clang/liblldbCommands/Makefile4
-rw-r--r--lib/clang/liblldbCore/Makefile7
-rw-r--r--lib/clang/liblldbDataFormatters/Makefile9
-rw-r--r--lib/clang/liblldbExpression/Makefile1
-rw-r--r--lib/clang/liblldbHostCommon/Makefile16
-rw-r--r--lib/clang/liblldbHostFreeBSD/Makefile5
-rw-r--r--lib/clang/liblldbHostPOSIX/Makefile16
-rw-r--r--lib/clang/liblldbInterpreter/Makefile6
-rw-r--r--lib/clang/liblldbPluginABISysV_ppc/Makefile15
-rw-r--r--lib/clang/liblldbPluginABISysV_ppc64/Makefile15
-rw-r--r--lib/clang/liblldbPluginInstructionARM64/Makefile10
-rw-r--r--lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile17
-rw-r--r--lib/clang/liblldbPluginJITLoaderGDB/Makefile15
-rw-r--r--lib/clang/liblldbPluginMemoryHistoryASan/Makefile15
-rw-r--r--lib/clang/liblldbPluginObjectFileJIT/Makefile17
-rw-r--r--lib/clang/liblldbPluginPlatformFreeBSD/Makefile4
-rw-r--r--lib/clang/liblldbPluginPlatformGDB/Makefile4
-rw-r--r--lib/clang/liblldbPluginProcessElfCore/Makefile1
-rw-r--r--lib/clang/liblldbPluginProcessGDBRemote/Makefile4
-rw-r--r--lib/clang/liblldbPluginProcessPOSIX/Makefile15
-rw-r--r--lib/clang/liblldbPluginProcessUtility/Makefile18
-rw-r--r--lib/clang/liblldbPluginSymbolFileDWARF/Makefile4
-rw-r--r--lib/clang/liblldbSymbol/Makefile1
-rw-r--r--lib/clang/liblldbTarget/Makefile16
-rw-r--r--lib/clang/liblldbUtility/Makefile8
-rw-r--r--lib/clang/libllvmaarch64asmparser/Makefile16
-rw-r--r--lib/clang/libllvmaarch64asmparser/Makefile.depend23
-rw-r--r--lib/clang/libllvmaarch64codegen/Makefile46
-rw-r--r--lib/clang/libllvmaarch64desc/Makefile24
-rw-r--r--lib/clang/libllvmaarch64desc/Makefile.depend47
-rw-r--r--lib/clang/libllvmaarch64disassembler/Makefile20
-rw-r--r--lib/clang/libllvmaarch64disassembler/Makefile.depend23
-rw-r--r--lib/clang/libllvmaarch64info/Makefile15
-rw-r--r--lib/clang/libllvmaarch64info/Makefile.depend (renamed from lib/clang/libllvmjit/Makefile.depend)3
-rw-r--r--lib/clang/libllvmaarch64instprinter/Makefile17
-rw-r--r--lib/clang/libllvmaarch64instprinter/Makefile.depend25
-rw-r--r--lib/clang/libllvmaarch64utils/Makefile15
-rw-r--r--lib/clang/libllvmaarch64utils/Makefile.depend21
-rw-r--r--lib/clang/libllvmanalysis/Makefile13
-rw-r--r--lib/clang/libllvmarmcodegen/Makefile3
-rw-r--r--lib/clang/libllvmarmdesc/Makefile6
-rw-r--r--lib/clang/libllvmasmprinter/Makefile11
-rw-r--r--lib/clang/libllvmcodegen/Makefile15
-rw-r--r--lib/clang/libllvmcore/Makefile12
-rw-r--r--lib/clang/libllvmdebuginfo/Makefile7
-rw-r--r--lib/clang/libllvmexecutionengine/Makefile2
-rw-r--r--lib/clang/libllvminstrumentation/Makefile3
-rw-r--r--lib/clang/libllvmipa/Makefile1
-rw-r--r--lib/clang/libllvmjit/Makefile12
-rw-r--r--lib/clang/libllvmmc/Makefile23
-rw-r--r--lib/clang/libllvmmcdisassembler/Makefile5
-rw-r--r--lib/clang/libllvmmipscodegen/Makefile7
-rw-r--r--lib/clang/libllvmmipsdesc/Makefile9
-rw-r--r--lib/clang/libllvmobjcarcopts/Makefile3
-rw-r--r--lib/clang/libllvmobject/Makefile4
-rw-r--r--lib/clang/libllvmpowerpccodegen/Makefile4
-rw-r--r--lib/clang/libllvmpowerpcdisassembler/Makefile16
-rw-r--r--lib/clang/libllvmpowerpcdisassembler/Makefile.depend23
-rw-r--r--lib/clang/libllvmprofiledata/Makefile18
-rw-r--r--lib/clang/libllvmprofiledata/Makefile.depend (renamed from lib/libmandoc/Makefile.depend)0
-rw-r--r--lib/clang/libllvmruntimedyld/Makefile3
-rw-r--r--lib/clang/libllvmscalaropts/Makefile8
-rw-r--r--lib/clang/libllvmselectiondag/Makefile1
-rw-r--r--lib/clang/libllvmsparccodegen/Makefile2
-rw-r--r--lib/clang/libllvmsupport/Makefile25
-rw-r--r--lib/clang/libllvmtablegen/Makefile1
-rw-r--r--lib/clang/libllvmtarget/Makefile4
-rw-r--r--lib/clang/libllvmtransformutils/Makefile7
-rw-r--r--lib/clang/libllvmx86asmparser/Makefile3
-rw-r--r--lib/clang/libllvmx86codegen/Makefile4
-rw-r--r--lib/clang/libllvmx86desc/Makefile3
-rw-r--r--lib/clang/libllvmx86disassembler/Makefile5
-rw-r--r--lib/csu/Makefile5
-rw-r--r--lib/csu/aarch64/Makefile44
-rw-r--r--lib/csu/aarch64/crt1.c (renamed from lib/libc/powerpc/gen/getcontextx.c)89
-rw-r--r--lib/csu/aarch64/crti.S48
-rw-r--r--lib/csu/aarch64/crtn.S44
-rw-r--r--lib/csu/i386/Makefile (renamed from lib/csu/i386-elf/Makefile)4
-rw-r--r--lib/csu/i386/Makefile.depend (renamed from lib/csu/i386-elf/Makefile.depend)0
-rw-r--r--lib/csu/i386/crt1_c.c (renamed from lib/csu/i386-elf/crt1_c.c)0
-rw-r--r--lib/csu/i386/crt1_s.S (renamed from lib/csu/i386-elf/crt1_s.S)0
-rw-r--r--lib/csu/i386/crti.S (renamed from lib/csu/i386-elf/crti.S)0
-rw-r--r--lib/csu/i386/crtn.S (renamed from lib/csu/i386-elf/crtn.S)0
-rw-r--r--lib/csu/powerpc64/Makefile7
-rw-r--r--lib/libarchive/Makefile22
-rw-r--r--lib/libarchive/config_freebsd.h7
-rw-r--r--lib/libarchive/test/Makefile3
-rw-r--r--lib/libblocksruntime/Makefile2
-rw-r--r--lib/libbluetooth/bluetooth.c2
-rw-r--r--lib/libbluetooth/dev.c1
-rw-r--r--lib/libbluetooth/hci.c1
-rw-r--r--lib/libbsnmp/libbsnmp/Makefile4
-rw-r--r--lib/libc++/Makefile16
-rw-r--r--lib/libc++/Makefile.depend1
-rw-r--r--lib/libc/Makefile17
-rw-r--r--lib/libc/Makefile.amd646
-rw-r--r--lib/libc/Makefile.i3866
-rw-r--r--lib/libc/aarch64/Makefile.inc9
-rw-r--r--lib/libc/aarch64/SYS.h63
-rw-r--r--lib/libc/aarch64/Symbol.map30
-rw-r--r--lib/libc/aarch64/_fpmath.h58
-rw-r--r--lib/libc/aarch64/arith.h19
-rw-r--r--lib/libc/aarch64/gd_qnan.h21
-rw-r--r--lib/libc/aarch64/gen/Makefile.inc10
-rw-r--r--lib/libc/aarch64/gen/_set_tp.c (renamed from lib/libc/posix1e/acl_size.c)21
-rw-r--r--lib/libc/aarch64/gen/_setjmp.S105
-rw-r--r--lib/libc/aarch64/gen/fabs.S33
-rw-r--r--lib/libc/aarch64/gen/flt_rounds.c (renamed from lib/libc/mips/sys/__vdso_gettc.c)27
-rw-r--r--lib/libc/aarch64/gen/setjmp.S123
-rw-r--r--lib/libc/aarch64/gen/sigsetjmp.S53
-rw-r--r--lib/libc/aarch64/sys/Makefile.inc25
-rw-r--r--lib/libc/aarch64/sys/brk.S93
-rw-r--r--lib/libc/aarch64/sys/cerror.S41
-rw-r--r--lib/libc/aarch64/sys/pipe.S52
-rw-r--r--lib/libc/aarch64/sys/sbrk.S79
-rw-r--r--lib/libc/aarch64/sys/shmat.S (renamed from lib/libc/powerpc/sys/__vdso_gettc.c)29
-rw-r--r--lib/libc/aarch64/sys/sigreturn.S35
-rw-r--r--lib/libc/aarch64/sys/syscall.S35
-rw-r--r--lib/libc/aarch64/sys/vfork.S42
-rw-r--r--lib/libc/amd64/sys/Makefile.inc3
-rw-r--r--lib/libc/arm/SYS.h2
-rw-r--r--lib/libc/arm/aeabi/Makefile.inc2
-rw-r--r--lib/libc/arm/aeabi/aeabi_vfp_double.S8
-rw-r--r--lib/libc/arm/aeabi/aeabi_vfp_float.S8
-rw-r--r--lib/libc/arm/gen/Makefile.inc5
-rw-r--r--lib/libc/arm/gen/_setjmp.S17
-rw-r--r--lib/libc/arm/gen/setjmp.S17
-rw-r--r--lib/libc/arm/string/ffs.S4
-rw-r--r--lib/libc/arm/string/memcmp.S4
-rw-r--r--lib/libc/arm/string/memcpy_arm.S37
-rw-r--r--lib/libc/arm/string/memcpy_xscale.S38
-rw-r--r--lib/libc/arm/string/memmove.S62
-rw-r--r--lib/libc/arm/string/memset.S102
-rw-r--r--lib/libc/arm/string/strlen.S14
-rw-r--r--lib/libc/arm/sys/Makefile.inc5
-rw-r--r--lib/libc/arm/sys/brk.S18
-rw-r--r--lib/libc/arm/sys/sbrk.S17
-rw-r--r--lib/libc/compat-43/creat.c13
-rw-r--r--lib/libc/db/hash/hash.c7
-rw-r--r--lib/libc/db/man/dbm.36
-rw-r--r--lib/libc/gen/Makefile.inc1
-rw-r--r--lib/libc/gen/Symbol.map3
-rw-r--r--lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c45
-rw-r--r--lib/libc/gen/_once_stub.c2
-rw-r--r--lib/libc/gen/_spinlock_stub.c41
-rw-r--r--lib/libc/gen/cap_rights_get.32
-rw-r--r--lib/libc/gen/directory.325
-rw-r--r--lib/libc/gen/disklabel.c23
-rw-r--r--lib/libc/gen/dlfcn.c12
-rw-r--r--lib/libc/gen/dlopen.34
-rw-r--r--lib/libc/gen/fstab.c2
-rw-r--r--lib/libc/gen/ftok.34
-rw-r--r--lib/libc/gen/fts.c11
-rw-r--r--lib/libc/gen/ftw.310
-rw-r--r--lib/libc/gen/getcap.35
-rw-r--r--lib/libc/gen/getgrent.c8
-rw-r--r--lib/libc/gen/getpwent.c10
-rw-r--r--lib/libc/gen/getutxent.32
-rw-r--r--lib/libc/gen/nice.336
-rw-r--r--lib/libc/gen/nice.c16
-rw-r--r--lib/libc/gen/nlist.c3
-rw-r--r--lib/libc/gen/pause.c9
-rw-r--r--lib/libc/gen/posix_spawn.312
-rw-r--r--lib/libc/gen/posix_spawn_file_actions_addopen.32
-rw-r--r--lib/libc/gen/posix_spawn_file_actions_init.32
-rw-r--r--lib/libc/gen/posix_spawnattr_getflags.32
-rw-r--r--lib/libc/gen/posix_spawnattr_getpgroup.32
-rw-r--r--lib/libc/gen/posix_spawnattr_getschedparam.32
-rw-r--r--lib/libc/gen/posix_spawnattr_getschedpolicy.32
-rw-r--r--lib/libc/gen/posix_spawnattr_getsigdefault.32
-rw-r--r--lib/libc/gen/posix_spawnattr_getsigmask.32
-rw-r--r--lib/libc/gen/posix_spawnattr_init.32
-rw-r--r--lib/libc/gen/raise.c8
-rw-r--r--lib/libc/gen/readdir.c6
-rw-r--r--lib/libc/gen/rewinddir.c1
-rw-r--r--lib/libc/gen/scandir.36
-rw-r--r--lib/libc/gen/sem_new.c6
-rw-r--r--lib/libc/gen/sem_post.35
-rw-r--r--lib/libc/gen/setmode.317
-rw-r--r--lib/libc/gen/setmode.c92
-rw-r--r--lib/libc/gen/setproctitle.c73
-rw-r--r--lib/libc/gen/sleep.38
-rw-r--r--lib/libc/gen/sleep.c8
-rw-r--r--lib/libc/gen/stringlist.c2
-rw-r--r--lib/libc/gen/syslog.c37
-rw-r--r--lib/libc/gen/telldir.c37
-rw-r--r--lib/libc/gen/telldir.h1
-rw-r--r--lib/libc/gen/termios.c18
-rw-r--r--lib/libc/gen/tls.c5
-rw-r--r--lib/libc/gen/trivial-getcontextx.c (renamed from lib/libc/arm/gen/getcontextx.c)0
-rw-r--r--lib/libc/gen/ttyname.c4
-rw-r--r--lib/libc/gen/ulimit.c12
-rw-r--r--lib/libc/gen/usleep.c5
-rw-r--r--lib/libc/gen/wait.c6
-rw-r--r--lib/libc/gen/wait3.c13
-rw-r--r--lib/libc/gen/waitid.c5
-rw-r--r--lib/libc/gen/waitpid.c6
-rw-r--r--lib/libc/gen/wordexp.c5
-rw-r--r--lib/libc/i386/sys/Makefile.inc3
-rw-r--r--lib/libc/iconv/__iconv.c2
-rw-r--r--lib/libc/iconv/bsd_iconv.c4
-rw-r--r--lib/libc/iconv/citrus_iconv.c8
-rw-r--r--lib/libc/iconv/citrus_iconv.h2
-rw-r--r--lib/libc/iconv/citrus_iconv_local.h4
-rw-r--r--lib/libc/iconv/citrus_none.c4
-rw-r--r--lib/libc/iconv/citrus_prop.c4
-rw-r--r--lib/libc/iconv/citrus_stdenc.h2
-rw-r--r--lib/libc/iconv/citrus_stdenc_local.h8
-rw-r--r--lib/libc/iconv/citrus_stdenc_template.h4
-rw-r--r--lib/libc/iconv/iconv-internal.h4
-rw-r--r--lib/libc/iconv/iconv.34
-rw-r--r--lib/libc/iconv/iconv.c2
-rw-r--r--lib/libc/iconv/iconv_compat.c4
-rw-r--r--lib/libc/iconv/iconvlist.34
-rw-r--r--lib/libc/include/compat.h9
-rw-r--r--lib/libc/include/libc_private.h163
-rw-r--r--lib/libc/locale/cXXrtomb_iconv.h3
-rw-r--r--lib/libc/locale/digittoint.32
-rw-r--r--lib/libc/locale/duplocale.32
-rw-r--r--lib/libc/locale/freelocale.32
-rw-r--r--lib/libc/locale/mbrtocXX_iconv.h3
-rw-r--r--lib/libc/locale/newlocale.32
-rw-r--r--lib/libc/locale/none.c2
-rw-r--r--lib/libc/locale/querylocale.32
-rw-r--r--lib/libc/locale/uselocale.32
-rw-r--r--lib/libc/locale/xlocale.32
-rw-r--r--lib/libc/mips/gen/Makefile.inc5
-rw-r--r--lib/libc/mips/gen/_setjmp.S83
-rw-r--r--lib/libc/mips/gen/getcontextx.c76
-rw-r--r--lib/libc/mips/gen/setjmp.S74
-rw-r--r--lib/libc/mips/gen/sigsetjmp.S2
-rw-r--r--lib/libc/mips/sys/Makefile.inc8
-rw-r--r--lib/libc/net/Symbol.map1
-rw-r--r--lib/libc/net/base64.c27
-rw-r--r--lib/libc/net/eui64.c1
-rw-r--r--lib/libc/net/getaddrinfo.34
-rw-r--r--lib/libc/net/getaddrinfo.c1
-rw-r--r--lib/libc/net/getifaddrs.322
-rw-r--r--lib/libc/net/ip6opt.c2
-rw-r--r--lib/libc/net/name6.c1
-rw-r--r--lib/libc/net/nsdispatch.c25
-rw-r--r--lib/libc/net/recv.c6
-rw-r--r--lib/libc/net/sctp_recvmsg.310
-rw-r--r--lib/libc/net/sctp_send.32
-rw-r--r--lib/libc/net/sctp_sys_calls.c10
-rw-r--r--lib/libc/net/send.c6
-rw-r--r--lib/libc/nls/catopen.32
-rw-r--r--lib/libc/nls/msgcat.c1
-rw-r--r--lib/libc/posix1e/acl_calc_mask.c1
-rw-r--r--lib/libc/posix1e/acl_set_flagset_np.32
-rw-r--r--lib/libc/posix1e/acl_strip.c14
-rw-r--r--lib/libc/powerpc/Makefile.inc2
-rw-r--r--lib/libc/powerpc/gen/Makefile.inc6
-rw-r--r--lib/libc/powerpc/gen/_set_tp.c3
-rw-r--r--lib/libc/powerpc/gen/_setjmp.S42
-rw-r--r--lib/libc/powerpc/gen/setjmp.S42
-rw-r--r--lib/libc/powerpc/gen/sigsetjmp.S42
-rw-r--r--lib/libc/powerpc/sys/Makefile.inc3
-rw-r--r--lib/libc/powerpc64/Makefile.inc2
-rw-r--r--lib/libc/powerpc64/gen/Makefile.inc5
-rw-r--r--lib/libc/powerpc64/gen/_set_tp.c3
-rw-r--r--lib/libc/powerpc64/gen/_setjmp.S36
-rw-r--r--lib/libc/powerpc64/gen/setjmp.S38
-rw-r--r--lib/libc/powerpc64/gen/sigsetjmp.S36
-rw-r--r--lib/libc/powerpc64/sys/Makefile.inc3
-rw-r--r--lib/libc/regex/engine.c4
-rw-r--r--lib/libc/regex/re_format.710
-rw-r--r--lib/libc/regex/regcomp.c29
-rw-r--r--lib/libc/regex/regex.36
-rw-r--r--lib/libc/rpc/clnt_dg.c3
-rw-r--r--lib/libc/rpc/crypt_client.c1
-rw-r--r--lib/libc/rpc/rpc.32
-rw-r--r--lib/libc/rpc/rpc_soc.c2
-rw-r--r--lib/libc/rpc/rpc_svc_reg.32
-rw-r--r--lib/libc/rpc/rpcbind.32
-rw-r--r--lib/libc/rpc/svc_vc.c2
-rw-r--r--lib/libc/sparc64/Makefile.inc2
-rw-r--r--lib/libc/sparc64/gen/Makefile.inc5
-rw-r--r--lib/libc/sparc64/gen/getcontextx.c76
-rw-r--r--lib/libc/sparc64/sys/Makefile.inc5
-rw-r--r--lib/libc/sparc64/sys/__vdso_gettc.c48
-rw-r--r--lib/libc/sparc64/sys/sigaction1.S (renamed from lib/libc/sparc64/sys/sigaction.S)5
-rw-r--r--lib/libc/stdio/fflush.c10
-rw-r--r--lib/libc/stdio/flags.c4
-rw-r--r--lib/libc/stdio/open_memstream.32
-rw-r--r--lib/libc/stdio/open_memstream.c2
-rw-r--r--lib/libc/stdio/open_wmemstream.c2
-rw-r--r--lib/libc/stdio/xprintf_float.c3
-rw-r--r--lib/libc/stdlib/Makefile.inc5
-rw-r--r--lib/libc/stdlib/Symbol.map2
-rw-r--r--lib/libc/stdlib/atexit.34
-rw-r--r--lib/libc/stdlib/exit.32
-rw-r--r--lib/libc/stdlib/jemalloc/Symbol.map1
-rw-r--r--lib/libc/stdlib/qsort.c53
-rw-r--r--lib/libc/stdlib/quick_exit.34
-rw-r--r--lib/libc/stdlib/random.35
-rw-r--r--lib/libc/stdlib/reallocarray.3142
-rw-r--r--lib/libc/stdlib/reallocarray.c42
-rw-r--r--lib/libc/stdlib/system.c15
-rw-r--r--lib/libc/stdlib/tdelete.c9
-rw-r--r--lib/libc/string/strlcat.c48
-rw-r--r--lib/libc/string/strlcpy.c37
-rw-r--r--lib/libc/string/strspn.32
-rw-r--r--lib/libc/sys/Makefile.inc67
-rw-r--r--lib/libc/sys/Symbol.map9
-rw-r--r--lib/libc/sys/__error.c25
-rw-r--r--lib/libc/sys/accept.c50
-rw-r--r--lib/libc/sys/accept4.c50
-rw-r--r--lib/libc/sys/access.22
-rw-r--r--lib/libc/sys/aio_suspend.c51
-rw-r--r--lib/libc/sys/cap_ioctls_limit.26
-rw-r--r--lib/libc/sys/close.c48
-rw-r--r--lib/libc/sys/closefrom.22
-rw-r--r--lib/libc/sys/connect.c50
-rw-r--r--lib/libc/sys/cpuset.23
-rw-r--r--lib/libc/sys/fcntl.c53
-rw-r--r--lib/libc/sys/fork.27
-rw-r--r--lib/libc/sys/fork.c48
-rw-r--r--lib/libc/sys/fsync.c47
-rw-r--r--lib/libc/sys/ftruncate.c55
-rw-r--r--lib/libc/sys/futimens.c97
-rw-r--r--lib/libc/sys/getdirentries.25
-rw-r--r--lib/libc/sys/getrlimit.22
-rw-r--r--lib/libc/sys/interposing_table.c89
-rw-r--r--lib/libc/sys/kevent.c53
-rw-r--r--lib/libc/sys/kqueue.2173
-rw-r--r--lib/libc/sys/lseek.c56
-rw-r--r--lib/libc/sys/mmap.220
-rw-r--r--lib/libc/sys/mmap.c56
-rw-r--r--lib/libc/sys/mount.29
-rw-r--r--lib/libc/sys/msync.c49
-rw-r--r--lib/libc/sys/nanosleep.c49
-rw-r--r--lib/libc/sys/open.26
-rw-r--r--lib/libc/sys/open.c59
-rw-r--r--lib/libc/sys/openat.c62
-rw-r--r--lib/libc/sys/poll.217
-rw-r--r--lib/libc/sys/poll.c49
-rw-r--r--lib/libc/sys/posix_openpt.24
-rw-r--r--lib/libc/sys/ppoll.c51
-rw-r--r--lib/libc/sys/pread.c57
-rw-r--r--lib/libc/sys/procctl.2304
-rw-r--r--lib/libc/sys/pselect.c51
-rw-r--r--lib/libc/sys/pwrite.c56
-rw-r--r--lib/libc/sys/read.c50
-rw-r--r--lib/libc/sys/readv.c50
-rw-r--r--lib/libc/sys/recvfrom.c53
-rw-r--r--lib/libc/sys/recvmsg.c50
-rw-r--r--lib/libc/sys/revoke.24
-rw-r--r--lib/libc/sys/sched_setscheduler.22
-rw-r--r--lib/libc/sys/select.c49
-rw-r--r--lib/libc/sys/sendmsg.c50
-rw-r--r--lib/libc/sys/sendto.c53
-rw-r--r--lib/libc/sys/setcontext.c52
-rw-r--r--lib/libc/sys/setresuid.27
-rw-r--r--lib/libc/sys/sigaction.c49
-rw-r--r--lib/libc/sys/sigprocmask.c49
-rw-r--r--lib/libc/sys/sigsuspend.c49
-rw-r--r--lib/libc/sys/sigtimedwait.c51
-rw-r--r--lib/libc/sys/sigwait.c14
-rw-r--r--lib/libc/sys/sigwaitinfo.22
-rw-r--r--lib/libc/sys/sigwaitinfo.c49
-rw-r--r--lib/libc/sys/socketpair.28
-rw-r--r--lib/libc/sys/swapcontext.c (renamed from lib/libc/gen/swapcontext.c)28
-rw-r--r--lib/libc/sys/trivial-vdso_tc.c (renamed from lib/libc/arm/sys/__vdso_gettc.c)0
-rw-r--r--lib/libc/sys/truncate.226
-rw-r--r--lib/libc/sys/truncate.c55
-rw-r--r--lib/libc/sys/utimensat.2292
-rw-r--r--lib/libc/sys/utimensat.c109
-rw-r--r--lib/libc/sys/vfork.26
-rw-r--r--lib/libc/sys/wait4.c49
-rw-r--r--lib/libc/sys/wait6.c52
-rw-r--r--lib/libc/sys/write.c50
-rw-r--r--lib/libc/sys/writev.c50
-rw-r--r--lib/libc/tests/c063/Makefile33
-rw-r--r--lib/libc/tests/db/Makefile1
-rw-r--r--lib/libc/tests/hash/Makefile8
-rw-r--r--lib/libc/tests/ssp/Makefile4
-rw-r--r--lib/libc/tests/sys/Makefile2
-rw-r--r--lib/libc/xdr/xdr_float.c3
-rw-r--r--lib/libcam/Makefile3
-rw-r--r--lib/libcapsicum/Makefile3
-rw-r--r--lib/libcapsicum/libcapsicum.318
-rw-r--r--lib/libcapsicum/libcapsicum.c14
-rw-r--r--lib/libcapsicum/libcapsicum.h4
-rw-r--r--lib/libcapsicum/libcapsicum_dns.c44
-rw-r--r--lib/libcapsicum/libcapsicum_grp.c35
-rw-r--r--lib/libcapsicum/libcapsicum_pwd.c22
-rw-r--r--lib/libcapsicum/libcapsicum_random.c2
-rw-r--r--lib/libcapsicum/libcapsicum_service.c2
-rw-r--r--lib/libcapsicum/libcapsicum_sysctl.c2
-rw-r--r--lib/libcasper/Makefile3
-rw-r--r--lib/libcasper/libcasper.c4
-rw-r--r--lib/libclang_rt/Makefile18
-rw-r--r--lib/libclang_rt/Makefile.inc26
-rw-r--r--lib/libclang_rt/asan/Makefile80
-rw-r--r--lib/libclang_rt/asan_cxx/Makefile11
-rw-r--r--lib/libclang_rt/profile/Makefile17
-rw-r--r--lib/libclang_rt/san/Makefile49
-rw-r--r--lib/libclang_rt/ubsan/Makefile17
-rw-r--r--lib/libclang_rt/ubsan_cxx/Makefile14
-rw-r--r--lib/libcom_err/Makefile2
-rw-r--r--lib/libcom_err/doc/Makefile7
-rw-r--r--lib/libcom_err/doc/com_err.texinfo615
-rw-r--r--lib/libcompat/4.3/rexec.c8
-rw-r--r--lib/libcompiler_rt/Makefile48
-rw-r--r--lib/libcrypt/tests/Makefile3
-rw-r--r--lib/libcuse/Makefile4
-rw-r--r--lib/libcxxrt/Makefile.depend.host13
-rw-r--r--lib/libdevctl/Makefile8
-rw-r--r--lib/libdevctl/devctl.3295
-rw-r--r--lib/libdevctl/devctl.c124
-rw-r--r--lib/libdevctl/devctl.h42
-rw-r--r--lib/libdevinfo/devinfo.h2
-rw-r--r--lib/libdevstat/Makefile3
-rw-r--r--lib/libdevstat/devstat.c24
-rw-r--r--lib/libdpv/Makefile3
-rw-r--r--lib/libdpv/Makefile.depend25
-rw-r--r--lib/libdpv/dpv.36
-rw-r--r--lib/libdwarf/Makefile16
-rw-r--r--lib/libedit/Makefile18
-rw-r--r--lib/libedit/Makefile.depend6
-rw-r--r--lib/libedit/TEST/rl1.c53
-rw-r--r--lib/libedit/TEST/tc1.c23
-rw-r--r--lib/libedit/TEST/wtc1.c281
-rw-r--r--lib/libedit/chared.c308
-rw-r--r--lib/libedit/chared.h53
-rw-r--r--lib/libedit/chartype.c360
-rw-r--r--lib/libedit/chartype.h27
-rw-r--r--lib/libedit/common.c280
-rw-r--r--lib/libedit/config.h290
-rw-r--r--lib/libedit/edit/readline/readline.h7
-rw-r--r--lib/libedit/editline.3162
-rw-r--r--lib/libedit/editrc.576
-rw-r--r--lib/libedit/el.c258
-rw-r--r--lib/libedit/el.h45
-rw-r--r--lib/libedit/eln.c401
-rw-r--r--lib/libedit/emacs.c158
-rw-r--r--lib/libedit/filecomplete.c305
-rw-r--r--lib/libedit/filecomplete.h9
-rw-r--r--lib/libedit/hist.c85
-rw-r--r--lib/libedit/hist.h30
-rw-r--r--lib/libedit/histedit.h150
-rw-r--r--lib/libedit/history.c459
-rw-r--r--lib/libedit/keymacro.c (renamed from lib/libedit/key.c)419
-rw-r--r--lib/libedit/keymacro.h (renamed from lib/libedit/key.h)60
-rw-r--r--lib/libedit/makelist34
-rw-r--r--lib/libedit/map.c226
-rw-r--r--lib/libedit/map.h19
-rw-r--r--lib/libedit/parse.c137
-rw-r--r--lib/libedit/parse.h11
-rw-r--r--lib/libedit/prompt.c59
-rw-r--r--lib/libedit/prompt.h13
-rw-r--r--lib/libedit/read.c235
-rw-r--r--lib/libedit/read.h5
-rw-r--r--lib/libedit/readline.c625
-rw-r--r--lib/libedit/refresh.c365
-rw-r--r--lib/libedit/refresh.h5
-rw-r--r--lib/libedit/search.c166
-rw-r--r--lib/libedit/search.h15
-rw-r--r--lib/libedit/sig.c14
-rw-r--r--lib/libedit/sig.h3
-rw-r--r--lib/libedit/sys.h99
-rw-r--r--lib/libedit/terminal.c (renamed from lib/libedit/term.c)1022
-rw-r--r--lib/libedit/terminal.h (renamed from lib/libedit/term.h)73
-rw-r--r--lib/libedit/tokenizer.c153
-rw-r--r--lib/libedit/tty.c379
-rw-r--r--lib/libedit/tty.h11
-rw-r--r--lib/libedit/vi.c349
-rw-r--r--lib/libelftc/Makefile30
-rw-r--r--lib/libelftc/elftc_version.c10
-rw-r--r--lib/libevent/Makefile1
-rw-r--r--lib/libexecinfo/Makefile3
-rw-r--r--lib/libexpat/Makefile2
-rw-r--r--lib/libfetch/Makefile6
-rw-r--r--lib/libfetch/common.c4
-rw-r--r--lib/libfetch/fetch.38
-rw-r--r--lib/libfigpar/Makefile.depend20
-rw-r--r--lib/libgeom/Makefile3
-rw-r--r--lib/libgeom/geom_xml2tree.c16
-rw-r--r--lib/libgpio/Makefile36
-rw-r--r--lib/libgpio/Makefile.depend20
-rw-r--r--lib/libgpio/gpio.3198
-rw-r--r--lib/libgpio/gpio.c278
-rw-r--r--lib/libgpio/libgpio.h110
-rw-r--r--lib/libgssapi/gss_acquire_cred.34
-rw-r--r--lib/libgssapi/gss_add_cred.34
-rw-r--r--lib/libgssapi/gss_add_oid_set_member.34
-rw-r--r--lib/libgssapi/gss_create_empty_oid_set.34
-rw-r--r--lib/libgssapi/gss_delete_sec_context.34
-rw-r--r--lib/libgssapi/gss_get_mic.34
-rw-r--r--lib/libgssapi/gss_import_sec_context.34
-rw-r--r--lib/libgssapi/gss_inquire_context.38
-rw-r--r--lib/libgssapi/gss_process_context_token.34
-rw-r--r--lib/libgssapi/gss_test_oid_set_member.32
-rw-r--r--lib/libgssapi/gss_unwrap.34
-rw-r--r--lib/libgssapi/gss_wrap.34
-rw-r--r--lib/libiconv/Makefile25
-rw-r--r--lib/libiconv_modules/BIG5/citrus_big5.c4
-rw-r--r--lib/libiconv_modules/DECHanyu/citrus_dechanyu.c4
-rw-r--r--lib/libiconv_modules/EUC/citrus_euc.c4
-rw-r--r--lib/libiconv_modules/EUCTW/citrus_euctw.c4
-rw-r--r--lib/libiconv_modules/GBK2K/citrus_gbk2k.c4
-rw-r--r--lib/libiconv_modules/HZ/citrus_hz.c4
-rw-r--r--lib/libiconv_modules/ISO2022/citrus_iso2022.c6
-rw-r--r--lib/libiconv_modules/JOHAB/citrus_johab.c4
-rw-r--r--lib/libiconv_modules/MSKanji/citrus_mskanji.c4
-rw-r--r--lib/libiconv_modules/UES/citrus_ues.c4
-rw-r--r--lib/libiconv_modules/UTF1632/citrus_utf1632.c4
-rw-r--r--lib/libiconv_modules/UTF7/citrus_utf7.c6
-rw-r--r--lib/libiconv_modules/UTF8/citrus_utf8.c4
-rw-r--r--lib/libiconv_modules/VIQR/citrus_viqr.c4
-rw-r--r--lib/libiconv_modules/ZW/citrus_zw.c4
-rw-r--r--lib/libiconv_modules/iconv_none/citrus_iconv_none.c2
-rw-r--r--lib/libiconv_modules/iconv_std/citrus_iconv_std.c6
-rw-r--r--lib/libjail/jail.c4
-rw-r--r--lib/libjail/jail_getid.c10
-rw-r--r--lib/libkiconv/xlat16_iconv.c19
-rw-r--r--lib/libkvm/kvm_aarch64.c (renamed from lib/libc/powerpc64/sys/__vdso_gettc.c)40
-rw-r--r--lib/libldns/Makefile3
-rw-r--r--lib/liblzma/Makefile42
-rw-r--r--lib/liblzma/Makefile.depend2
-rw-r--r--lib/liblzma/Symbol.map20
-rw-r--r--lib/liblzma/Versions.def4
-rw-r--r--lib/liblzma/config.h429
-rw-r--r--lib/libmagic/Makefile3
-rw-r--r--lib/libmagic/config.h37
-rw-r--r--lib/libmandoc/Makefile20
-rw-r--r--lib/libmd/Makefile8
-rw-r--r--lib/libmd/Makefile.depend.host36
-rw-r--r--lib/libmd/md4.h28
-rw-r--r--lib/libmd/md4c.c15
-rw-r--r--lib/libmd/md5.h37
-rw-r--r--lib/libmd/md5c.c19
-rw-r--r--lib/libmd/mdXhl.c17
-rw-r--r--lib/libmd/ripemd.h35
-rw-r--r--lib/libmd/rmd160c.c19
-rw-r--r--lib/libmd/sha.h68
-rw-r--r--lib/libmd/sha1c.c30
-rw-r--r--lib/libmd/sha256.h32
-rw-r--r--lib/libmd/sha256c.c15
-rw-r--r--lib/libmd/sha512.h32
-rw-r--r--lib/libmd/sha512c.c15
-rw-r--r--lib/libmd/shadriver.c3
-rw-r--r--lib/libmemstat/Makefile3
-rw-r--r--lib/libmp/Makefile3
-rw-r--r--lib/libmp/tests/Makefile3
-rw-r--r--lib/libmt/Makefile12
-rw-r--r--lib/libmt/Makefile.depend22
-rw-r--r--lib/libmt/mt.3454
-rw-r--r--lib/libmt/mtlib.c773
-rw-r--r--lib/libmt/mtlib.h122
-rw-r--r--lib/libnetgraph/debug.c29
-rw-r--r--lib/libnv/Makefile184
-rw-r--r--lib/libnv/dnv.h106
-rw-r--r--lib/libnv/dnvlist.c252
-rw-r--r--lib/libnv/nv.397
-rw-r--r--lib/libnv/nv.h275
-rw-r--r--lib/libnv/nv_impl.h134
-rw-r--r--lib/libnv/nvlist.c1848
-rw-r--r--lib/libnv/nvlist_impl.h47
-rw-r--r--lib/libnv/nvpair.c1282
-rw-r--r--lib/libnv/nvpair_impl.h92
-rw-r--r--lib/libnv/tests/Makefile9
-rw-r--r--lib/libnv/tests/dnv_tests.cc567
-rw-r--r--lib/libnv/tests/nv_tests.cc1275
-rw-r--r--lib/libnv/tests/nvlist_send_recv_test.c23
-rw-r--r--lib/libopie/Makefile3
-rw-r--r--lib/libpam/libpam/tests/Makefile3
-rw-r--r--lib/libpam/modules/Makefile.inc3
-rw-r--r--lib/libpam/modules/modules.inc2
-rw-r--r--lib/libpam/modules/pam_guest/pam_guest.82
-rw-r--r--lib/libpam/modules/pam_krb5/Makefile3
-rw-r--r--lib/libpam/modules/pam_ksu/Makefile3
-rw-r--r--lib/libpam/modules/pam_nologin/Makefile3
-rw-r--r--lib/libpam/modules/pam_opie/Makefile3
-rw-r--r--lib/libpam/modules/pam_opieaccess/Makefile3
-rw-r--r--lib/libpam/modules/pam_passwdqc/Makefile3
-rw-r--r--lib/libpam/modules/pam_radius/Makefile3
-rw-r--r--lib/libpam/modules/pam_radius/pam_radius.c30
-rw-r--r--lib/libpam/modules/pam_ssh/Makefile4
-rw-r--r--lib/libpam/modules/pam_tacplus/Makefile3
-rw-r--r--lib/libpam/modules/pam_unix/Makefile6
-rw-r--r--lib/libpcap/Makefile3
-rw-r--r--lib/libpcap/config.h24
-rw-r--r--lib/libpjdlog/Makefile3
-rw-r--r--lib/libpmc/libpmc.c206
-rw-r--r--lib/libpmc/pmc.31
-rw-r--r--lib/libpmc/pmc.corei7.38
-rw-r--r--lib/libpmc/pmc.corei7uc.38
-rw-r--r--lib/libpmc/pmc.haswell.3153
-rw-r--r--lib/libpmc/pmc.haswellxeon.3956
-rw-r--r--lib/libpmc/pmc.ivybridge.3141
-rw-r--r--lib/libpmc/pmc.ivybridgexeon.3141
-rw-r--r--lib/libpmc/pmc.sandybridge.3100
-rw-r--r--lib/libpmc/pmc.sandybridgexeon.3112
-rw-r--r--lib/libpmc/pmc.soft.38
-rw-r--r--lib/libpmc/pmc.ucf.38
-rw-r--r--lib/libpmc/pmc.westmere.38
-rw-r--r--lib/libpmc/pmc.westmereuc.38
-rw-r--r--lib/libpmc/pmc.xscale.32
-rw-r--r--lib/libpmc/pmc_capabilities.32
-rw-r--r--lib/libproc/Makefile12
-rw-r--r--lib/libproc/Makefile.depend1
-rw-r--r--lib/libproc/proc_bkpt.c3
-rw-r--r--lib/libproc/proc_regs.c8
-rw-r--r--lib/libproc/proc_sym.c42
-rw-r--r--lib/libproc/tests/proc_test.c40
-rw-r--r--lib/libprocstat/Makefile33
-rw-r--r--lib/libprocstat/libprocstat.353
-rw-r--r--lib/libprocstat/udf.c1
-rw-r--r--lib/libradius/Makefile10
-rw-r--r--lib/librpcsec_gss/Makefile3
-rw-r--r--lib/librpcsec_gss/Makefile.depend1
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_error.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_mech_info.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_mechanisms.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_principal_name.34
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_versions.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_getcred.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_is_installed.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_max_data_length.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_mech_to_oid.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_oid_to_mech.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_qop_to_num.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_seccreate.36
-rw-r--r--lib/librpcsec_gss/rpc_gss_set_callback.34
-rw-r--r--lib/librpcsec_gss/rpc_gss_set_defaults.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_set_svc_name.34
-rw-r--r--lib/librpcsec_gss/rpc_gss_svc_max_data_length.32
-rw-r--r--lib/librpcsec_gss/rpcsec_gss.38
-rw-r--r--lib/librt/Makefile7
-rw-r--r--lib/librt/Makefile.amd646
-rw-r--r--lib/librt/Makefile.i3866
-rw-r--r--lib/librt/tests/Makefile3
-rw-r--r--lib/librtld_db/librtld_db.34
-rw-r--r--lib/libsdp/search.c1
-rw-r--r--lib/libsdp/service.c1
-rw-r--r--lib/libsdp/session.c5
-rw-r--r--lib/libsdp/util.c1
-rw-r--r--lib/libsmb/Makefile3
-rw-r--r--lib/libsqlite3/Makefile39
-rw-r--r--lib/libsqlite3/Makefile.depend21
-rw-r--r--lib/libstand/Makefile45
-rw-r--r--lib/libstand/cd9660.c15
-rw-r--r--lib/libstand/dosfs.c3
-rw-r--r--lib/libstand/ext2fs.c12
-rw-r--r--lib/libstand/libstand.32
-rw-r--r--lib/libstand/nandfs.c2
-rw-r--r--lib/libstand/nfs.c4
-rw-r--r--lib/libstand/powerpc/_setjmp.S4
-rw-r--r--lib/libstand/powerpc/syncicache.c103
-rw-r--r--lib/libstand/printf.c4
-rw-r--r--lib/libstand/read.c2
-rw-r--r--lib/libstand/stand.h3
-rw-r--r--lib/libstand/tftp.c4
-rw-r--r--lib/libstand/twiddle.c21
-rw-r--r--lib/libstand/ufs.c14
-rw-r--r--lib/libstand/write.c2
-rw-r--r--lib/libstdthreads/Makefile3
-rw-r--r--lib/libstdthreads/Makefile.depend1
-rw-r--r--lib/libstdthreads/mtx.c2
-rw-r--r--lib/libstdthreads/thrd.c3
-rw-r--r--lib/libtacplus/Makefile3
-rw-r--r--lib/libthr/Makefile9
-rw-r--r--lib/libthr/Makefile.amd646
-rw-r--r--lib/libthr/Makefile.i3866
-rw-r--r--lib/libthr/arch/aarch64/Makefile.inc2
-rw-r--r--lib/libthr/arch/aarch64/include/pthread_md.h (renamed from lib/libc/powerpc64/gen/getcontextx.c)78
-rw-r--r--lib/libthr/arch/amd64/Makefile.inc2
-rw-r--r--lib/libthr/arch/amd64/amd64/pthread_md.c55
-rw-r--r--lib/libthr/arch/amd64/include/pthread_md.h3
-rw-r--r--lib/libthr/arch/arm/Makefile.inc3
-rw-r--r--lib/libthr/arch/arm/arm/pthread_md.c53
-rw-r--r--lib/libthr/arch/arm/include/pthread_md.h6
-rw-r--r--lib/libthr/arch/i386/Makefile.inc2
-rw-r--r--lib/libthr/arch/i386/i386/pthread_md.c57
-rw-r--r--lib/libthr/arch/i386/include/pthread_md.h6
-rw-r--r--lib/libthr/arch/mips/Makefile.inc3
-rw-r--r--lib/libthr/arch/mips/include/pthread_md.h6
-rw-r--r--lib/libthr/arch/mips/mips/pthread_md.c59
-rw-r--r--lib/libthr/arch/powerpc/Makefile.inc3
-rw-r--r--lib/libthr/arch/powerpc/include/pthread_md.h17
-rw-r--r--lib/libthr/arch/powerpc/powerpc/pthread_md.c54
-rw-r--r--lib/libthr/arch/sparc64/Makefile.inc2
-rw-r--r--lib/libthr/arch/sparc64/include/pthread_md.h6
-rw-r--r--lib/libthr/libthr.342
-rw-r--r--lib/libthr/pthread.map96
-rw-r--r--lib/libthr/sys/thr_error.c3
-rw-r--r--lib/libthr/tests/Makefile2
-rw-r--r--lib/libthr/thread/Makefile.inc1
-rw-r--r--lib/libthr/thread/thr_barrier.c5
-rw-r--r--lib/libthr/thread/thr_clean.c2
-rw-r--r--lib/libthr/thread/thr_create.c8
-rw-r--r--lib/libthr/thread/thr_ctrdtr.c (renamed from lib/libthr/arch/sparc64/sparc64/pthread_md.c)2
-rw-r--r--lib/libthr/thread/thr_fork.c6
-rw-r--r--lib/libthr/thread/thr_init.c10
-rw-r--r--lib/libthr/thread/thr_mutex.c7
-rw-r--r--lib/libthr/thread/thr_printf.c1
-rw-r--r--lib/libthr/thread/thr_private.h29
-rw-r--r--lib/libthr/thread/thr_sig.c180
-rw-r--r--lib/libthr/thread/thr_spec.c201
-rw-r--r--lib/libthr/thread/thr_spinlock.c10
-rw-r--r--lib/libthr/thread/thr_syscalls.c558
-rw-r--r--lib/libthread_db/arch/aarch64/libpthread_md.c96
-rw-r--r--lib/libthread_db/arch/i386/libpthread_md.c2
-rw-r--r--lib/libucl/Makefile9
-rw-r--r--lib/libufs/Makefile1
-rw-r--r--lib/libulog/Makefile3
-rw-r--r--lib/libunbound/Makefile11
-rw-r--r--lib/libusb/Makefile3
-rw-r--r--lib/libusb/libusb.34
-rw-r--r--lib/libusb/libusb.h2
-rw-r--r--lib/libusb/libusb20.32
-rw-r--r--lib/libusb/libusb20_desc.h6
-rw-r--r--lib/libutil/gr_util.c25
-rw-r--r--lib/libutil/quotafile.34
-rw-r--r--lib/libutil/tests/Makefile3
-rw-r--r--lib/libvmmapi/Makefile2
-rw-r--r--lib/libvmmapi/vmmapi.c131
-rw-r--r--lib/libvmmapi/vmmapi.h32
-rw-r--r--lib/libxo/Makefile48
-rw-r--r--lib/msun/Makefile4
-rw-r--r--lib/msun/Makefile.amd646
-rw-r--r--lib/msun/Makefile.i3866
-rw-r--r--lib/msun/aarch64/Makefile.inc4
-rw-r--r--lib/msun/aarch64/fenv.c56
-rw-r--r--lib/msun/aarch64/fenv.h246
-rw-r--r--lib/msun/ld128/k_expl.h2
-rw-r--r--lib/msun/ld80/k_expl.h2
-rw-r--r--lib/msun/man/cexp.32
-rw-r--r--lib/msun/man/complex.32
-rw-r--r--lib/msun/man/csqrt.32
-rw-r--r--lib/msun/man/j0.345
-rw-r--r--lib/msun/man/lgamma.33
-rw-r--r--lib/msun/man/nextafter.34
-rw-r--r--lib/msun/man/sin.32
-rw-r--r--lib/msun/src/catrig.c64
-rw-r--r--lib/msun/src/catrigf.c64
-rw-r--r--lib/msun/src/e_j0.c30
-rw-r--r--lib/msun/src/e_j0f.c45
-rw-r--r--lib/msun/src/e_j1.c28
-rw-r--r--lib/msun/src/e_j1f.c43
-rw-r--r--lib/msun/src/e_jn.c10
-rw-r--r--lib/msun/src/e_jnf.c11
-rw-r--r--lib/msun/src/k_exp.c2
-rw-r--r--lib/msun/src/k_expf.c2
-rw-r--r--lib/msun/src/math_private.h18
-rw-r--r--lib/msun/src/s_ccosh.c28
-rw-r--r--lib/msun/src/s_ccoshf.c28
-rw-r--r--lib/msun/src/s_cexp.c12
-rw-r--r--lib/msun/src/s_cexpf.c12
-rw-r--r--lib/msun/src/s_conj.c2
-rw-r--r--lib/msun/src/s_conjf.c2
-rw-r--r--lib/msun/src/s_conjl.c2
-rw-r--r--lib/msun/src/s_cproj.c2
-rw-r--r--lib/msun/src/s_cprojf.c2
-rw-r--r--lib/msun/src/s_cprojl.c2
-rw-r--r--lib/msun/src/s_csinh.c30
-rw-r--r--lib/msun/src/s_csinhf.c30
-rw-r--r--lib/msun/src/s_csqrt.c14
-rw-r--r--lib/msun/src/s_csqrtf.c14
-rw-r--r--lib/msun/src/s_csqrtl.c14
-rw-r--r--lib/msun/src/s_ctanh.c14
-rw-r--r--lib/msun/src/s_ctanhf.c14
-rw-r--r--lib/msun/src/s_scalbln.c40
-rw-r--r--lib/msun/tests/Makefile12
-rw-r--r--lib/ncurses/Makefile7
-rw-r--r--lib/ncurses/form/Makefile3
-rw-r--r--lib/ncurses/form/Makefile.depend1
-rw-r--r--lib/ncurses/formw/Makefile.depend1
-rw-r--r--lib/ncurses/menu/Makefile3
-rw-r--r--lib/ncurses/menu/Makefile.depend1
-rw-r--r--lib/ncurses/menuw/Makefile.depend1
-rw-r--r--lib/ncurses/panel/Makefile3
-rw-r--r--lib/ncurses/panel/Makefile.depend1
-rw-r--r--lib/ncurses/panelw/Makefile.depend1
832 files changed, 21496 insertions, 12341 deletions
diff --git a/lib/Makefile b/lib/Makefile
index 8ca673ac2a83..bee05ab7120b 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -8,11 +8,12 @@
# and the main list to avoid needing a SUBDIR_DEPEND line on every library
# naming just these few items.
-SUBDIR_ORDERED= ${_csu} \
+SUBDIR_ORDERED= csu \
.WAIT \
libc \
libc_nonshared \
libcompiler_rt \
+ ${_libclang_rt} \
${_libcplusplus} \
${_libcxxrt} \
libelf \
@@ -40,18 +41,20 @@ SUBDIR= ${SUBDIR_ORDERED} \
${_libcom_err} \
libcompat \
libcrypt \
+ libdevctl \
libdevinfo \
libdevstat \
libdpv \
libdwarf \
libedit \
+ ${_libelftc} \
${_libevent} \
libexecinfo \
libexpat \
libfetch \
libfigpar \
libgeom \
- ${_libgpib} \
+ ${_libgpio} \
${_libgssapi} \
${_librpcsec_gss} \
${_libiconv_modules} \
@@ -61,12 +64,12 @@ SUBDIR= ${SUBDIR_ORDERED} \
libkvm \
${_libldns} \
liblzma \
- libmagic \
- libmandoc \
+ ${_libmagic} \
libmemstat \
libmd \
${_libmilter} \
${_libmp} \
+ libmt \
${_libnandfs} \
libnetbsd \
${_libnetgraph} \
@@ -80,7 +83,7 @@ SUBDIR= ${SUBDIR_ORDERED} \
${_libpmc} \
${_libproc} \
libprocstat \
- libradius \
+ ${_libradius} \
librpcsvc \
librt \
${_librtld_db} \
@@ -90,6 +93,7 @@ SUBDIR= ${SUBDIR_ORDERED} \
${_libsmb} \
${_libsmdb} \
${_libsmutil} \
+ libsqlite3 \
libstand \
libstdbuf \
libstdthreads \
@@ -139,7 +143,7 @@ SUBDIR_DEPEND_liblibrpcsec_gss= libgssapi
SUBDIR_DEPEND_libmagic= libz
SUBDIR_DEPEND_libmemstat= libkvm
SUBDIR_DEPEND_libopie= libmd
-SUBDIR_DEPEND_libpam= libcrypt libopie libradius librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
+SUBDIR_DEPEND_libpam= libcrypt libopie ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
SUBDIR_DEPEND_libpjdlog= libutil
SUBDIR_DEPEND_libprocstat= libkvm libutil
SUBDIR_DEPEND_libradius= libmd
@@ -149,16 +153,7 @@ SUBDIR_DEPEND_libstdc++= msun
SUBDIR_DEPEND_libtacplus= libmd
SUBDIR_DEPEND_libulog= libmd
SUBDIR_DEPEND_libunbound= ${_libldns}
-
-.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
-_csu=csu/${MACHINE_ARCH}-elf
-.elif exists(${.CURDIR}/csu/${MACHINE_ARCH})
-_csu=csu/${MACHINE_ARCH}
-.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile)
-_csu=csu/${MACHINE_CPUARCH}
-.else
-_csu=csu
-.endif
+SUBDIR_DEPEND_liblzma= ${_libthr}
# NB: keep these sorted by MK_* knobs
@@ -188,8 +183,16 @@ _clang= clang
_cuse= libcuse
.endif
-.if ${MK_GPIB} != "no"
-_libgpib= libgpib
+.if ${MK_ELFTOOLCHAIN_TOOLS} != "no"
+_libelftc= libelftc
+.endif
+
+.if ${MK_FILE} != "no"
+_libmagic= libmagic
+.endif
+
+.if ${MK_GPIO} != "no"
+_libgpio= libgpio
.endif
.if ${MK_GSSAPI} != "no"
@@ -209,6 +212,15 @@ _libcom_err= libcom_err
_libldns= libldns
.endif
+# The libraries under libclang_rt can only be built by clang, and only make
+# sense to build when clang is enabled at all. Furthermore, they can only be
+# built for certain architectures.
+.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \
+ (${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \
+ (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb"))
+_libclang_rt= libclang_rt
+.endif
+
.if ${MK_LIBCPLUSPLUS} != "no"
_libcxxrt= libcxxrt
_libcplusplus= libc++
@@ -242,8 +254,10 @@ _librtld_db= librtld_db
.endif
.if ${MACHINE_CPUARCH} == "amd64"
+.if ${MK_BHYVE} != "no"
_libvmmapi= libvmmapi
.endif
+.endif
.if ${MACHINE_CPUARCH} == "mips"
_libproc= libproc
@@ -260,6 +274,12 @@ _libsmb= libsmb
_libsmb= libsmb
.endif
+.if ${MACHINE_CPUARCH} == "arm"
+_libsmb= libsmb
+_libproc= libproc
+_librtld_db= librtld_db
+.endif
+
.if ${MK_OPENSSL} != "no"
_libmp= libmp
.endif
@@ -268,6 +288,10 @@ _libmp= libmp
_libpmc= libpmc
.endif
+.if ${MK_RADIUS_SUPPORT} != "no"
+_libradius= libradius
+.endif
+
.if ${MK_SENDMAIL} != "no"
_libmilter= libmilter
_libsm= libsm
diff --git a/lib/atf/libatf-c++/Makefile b/lib/atf/libatf-c++/Makefile
index 352a8f4caa4d..13f3fe441ffd 100644
--- a/lib/atf/libatf-c++/Makefile
+++ b/lib/atf/libatf-c++/Makefile
@@ -28,13 +28,12 @@
.include <src.opts.mk>
.include <bsd.init.mk>
-LIB= atf-c++
+LIB_CXX= atf-c++
PRIVATELIB= true
SHLIB_MAJOR= 2
# libatf-c++ depends on the C version of the ATF library to build.
-DPADD= ${LIBATF_C}
-LDADD= -latf-c
+LIBADD+= atf_c
LDFLAGS+= -L${.OBJDIR}/../libatf-c
diff --git a/lib/atf/libatf-c++/Makefile.depend b/lib/atf/libatf-c++/Makefile.depend
index c93850e2886e..5f89eeec2c06 100644
--- a/lib/atf/libatf-c++/Makefile.depend
+++ b/lib/atf/libatf-c++/Makefile.depend
@@ -3,10 +3,17 @@
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
include \
include/xlocale \
+ lib/${CSU_DIR} \
lib/atf/libatf-c \
+ lib/libc \
lib/libc++ \
+ lib/libcompiler_rt \
+ lib/libcxxrt \
+ lib/msun \
usr.bin/xinstall.host \
diff --git a/lib/clang/Makefile b/lib/clang/Makefile
index 328aa7871a92..a7513c3a9ed4 100644
--- a/lib/clang/Makefile
+++ b/lib/clang/Makefile
@@ -11,11 +11,6 @@ _libclangstaticanalyzer= \
_libclangarcmigrate= \
libclangarcmigrate
.endif # MK_CLANG_FULL
-.if ${MK_CLANG_FULL} != "no" || ${MK_LLDB} != "no"
-_libclangrewriter= \
- libclangrewritecore \
- libclangrewritefrontend
-.endif # (MK_CLANG_FULL || MK_LLDB)
SUBDIR= libclanganalysis \
${_libclangarcmigrate} \
@@ -28,7 +23,8 @@ SUBDIR= libclanganalysis \
libclangfrontendtool \
libclanglex \
libclangparse \
- ${_libclangrewriter} \
+ libclangrewritefrontend \
+ libclangrewrite \
libclangsema \
libclangserialization \
${_libclangstaticanalyzer} \
@@ -47,10 +43,12 @@ SUBDIR= libclanganalysis \
libllvmirreader \
libllvmlinker \
libllvmmc \
+ libllvmmcdisassembler \
libllvmmcparser \
libllvmobjcarcopts \
libllvmobject \
libllvmoption \
+ libllvmprofiledata \
libllvmscalaropts \
libllvmselectiondag \
libllvmsupport \
@@ -59,6 +57,13 @@ SUBDIR= libclanganalysis \
libllvmtransformutils \
libllvmvectorize \
\
+ libllvmaarch64asmparser \
+ libllvmaarch64codegen \
+ libllvmaarch64desc \
+ libllvmaarch64disassembler \
+ libllvmaarch64info \
+ libllvmaarch64instprinter \
+ libllvmaarch64utils \
libllvmarmasmparser \
libllvmarmcodegen \
libllvmarmdesc \
@@ -74,6 +79,7 @@ SUBDIR= libclanganalysis \
libllvmpowerpcasmparser \
libllvmpowerpccodegen \
libllvmpowerpcdesc \
+ libllvmpowerpcdisassembler \
libllvmpowerpcinfo \
libllvmpowerpcinstprinter \
libllvmsparcasmparser \
@@ -96,8 +102,6 @@ SUBDIR+=libllvmdebuginfo
.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no"
SUBDIR+=libllvmexecutionengine \
libllvminterpreter \
- libllvmjit \
- libllvmmcdisassembler \
libllvmmcjit \
libllvmruntimedyld
.endif # MK_CLANG_EXTRAS | LLDB
@@ -113,19 +117,27 @@ SUBDIR+=liblldb \
liblldbExpression \
liblldbHostCommon \
liblldbHostFreeBSD \
+ liblldbHostPOSIX \
liblldbInterpreter \
liblldbSymbol \
liblldbTarget \
liblldbUtility \
\
+ liblldbPluginABISysV_ppc \
+ liblldbPluginABISysV_ppc64 \
liblldbPluginABISysV_x86_64 \
liblldbPluginCXXItaniumABI \
liblldbPluginDisassemblerLLVM \
liblldbPluginDynamicLoaderStatic \
liblldbPluginDynamicLoaderPosixDYLD \
liblldbPluginInstructionARM \
+ liblldbPluginInstructionARM64 \
+ liblldbPluginInstrumentationRuntimeAddressSanitizer \
+ liblldbPluginJITLoaderGDB \
+ liblldbPluginMemoryHistoryASan \
liblldbPluginObjectContainerBSDArchive \
liblldbPluginObjectFileELF \
+ liblldbPluginObjectFileJIT \
liblldbPluginPlatformFreeBSD \
liblldbPluginPlatformGDB \
liblldbPluginProcessElfCore \
diff --git a/lib/clang/clang.build.mk b/lib/clang/clang.build.mk
index 0f681786a137..c4ce7246f75b 100644
--- a/lib/clang/clang.build.mk
+++ b/lib/clang/clang.build.mk
@@ -12,7 +12,6 @@ CFLAGS+= -I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \
.if ${MK_CLANG_FULL} != "no"
CFLAGS+= -DCLANG_ENABLE_ARCMT \
- -DCLANG_ENABLE_REWRITER \
-DCLANG_ENABLE_STATIC_ANALYZER
.endif # MK_CLANG_FULL
@@ -30,22 +29,29 @@ TARGET_ABI= gnueabi
TARGET_ABI= unknown
.endif
-TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/}-${TARGET_ABI}-freebsd11.0
-BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/}-unknown-freebsd11.0
+TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/:C/arm64/aarch64/}-${TARGET_ABI}-freebsd11.0
+BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/:C/arm64/aarch64/}-unknown-freebsd11.0
CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \
-DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \
-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"
-CXXFLAGS+= -fno-exceptions -fno-rtti
+CXXFLAGS+= -std=c++11 -fno-exceptions -fno-rtti
+CXXFLAGS.clang+= -stdlib=libc++
.PATH: ${LLVM_SRCS}/${SRCDIR}
-.if ${MACHINE} == "host" && defined(EARLY_BUILD)
+#.info ${MACHINE BOOTSTRAPPING_TOOLS LEGACY_TOOLS:L:@v@$v=${$v}@}
+.if empty(TOOLSDIR) || !exists(${TOOLSDIR}/usr/bin/clang-tblgen)
+.if ${MACHINE} == "host" && defined(BOOTSTRAPPING_TOOLS)
.if !empty(LEGACY_TOOLS) && exists(${LEGACY_TOOLS}/usr/bin/tblgen)
TOOLSDIR= ${LEGACY_TOOLS}
.endif
.endif
-.if ${MK_STAGING} == "yes"
-TOOLSDIR?= ${STAGE_HOST_OBJTOP}
+.if ${MK_STAGING} == "yes" && exists(${STAGE_HOST_OBJTOP:Uno}/usr/bin/tblgen)
+TOOLSDIR= ${STAGE_HOST_OBJTOP}
+.endif
+.if exists(${LEGACY_TOOLS:Uno}/usr/bin/tblgen)
+TOOLSDIR= ${LEGACY_TOOLS}
+.endif
.endif
TOOLSDIR?=
.if !empty(TOOLSDIR) && exists(${TOOLSDIR}/usr/bin/clang-tblgen)
@@ -54,13 +60,14 @@ CLANG_TBLGEN= ${TOOLSDIR}/usr/bin/clang-tblgen
.endif
TBLGEN?= tblgen
CLANG_TBLGEN?= clang-tblgen
+#.info ${TOOLSDIR TBLGEN CLANG_TBLGEN:L:@v@$v=${$v}@}
Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td
${TBLGEN} -gen-intrinsic \
-I ${LLVM_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${LLVM_SRCS}/include/llvm/IR/Intrinsics.td
.for arch in \
- ARM/ARM Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86
+ AArch64/AArch64 ARM/ARM Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86
. for hdr in \
AsmMatcher/-gen-asm-matcher \
AsmWriter1/-gen-asm-writer,-asmwriternum=1 \
@@ -71,7 +78,7 @@ Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td
DisassemblerTables/-gen-disassembler \
FastISel/-gen-fast-isel \
InstrInfo/-gen-instr-info \
- MCCodeEmitter/-gen-emitter,-mc-emitter \
+ MCCodeEmitter/-gen-emitter \
MCPseudoLowering/-gen-pseudo-lowering \
RegisterInfo/-gen-register-info \
SubtargetInfo/-gen-subtarget
@@ -93,8 +100,8 @@ AttrDump.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
-AttrIdentifierArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -gen-clang-attr-identifier-arg-list \
+AttrHasAttributeImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
+ ${CLANG_TBLGEN} -gen-clang-attr-has-attribute-impl \
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
@@ -103,11 +110,6 @@ AttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
-AttrLateParsed.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -gen-clang-attr-late-parsed-list \
- -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
- ${CLANG_SRCS}/include/clang/Basic/Attr.td
-
AttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
${CLANG_TBLGEN} -gen-clang-attr-list \
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
@@ -128,6 +130,11 @@ AttrParsedAttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
+AttrParserStringSwitches.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
+ ${CLANG_TBLGEN} -gen-clang-attr-parser-string-switches \
+ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
+ ${CLANG_SRCS}/include/clang/Basic/Attr.td
+
AttrPCHRead.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
${CLANG_TBLGEN} -gen-clang-attr-pch-read \
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
@@ -138,11 +145,6 @@ AttrPCHWrite.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
-AttrSpellings.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -gen-clang-attr-spelling-list \
- -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
- ${CLANG_SRCS}/include/clang/Basic/Attr.td
-
AttrSpellingListIndex.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
${CLANG_TBLGEN} -gen-clang-attr-spelling-index \
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
@@ -153,8 +155,8 @@ AttrTemplateInstantiate.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
-AttrTypeArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
- ${CLANG_TBLGEN} -gen-clang-attr-type-arg-list \
+AttrVisitor.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td
+ ${CLANG_TBLGEN} -gen-clang-attr-ast-visitor \
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Basic/Attr.td
@@ -233,12 +235,6 @@ Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td
-d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/include/clang/Driver/Options.td
-CC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td
- ${TBLGEN} -gen-opt-parser-defs \
- -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \
- -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
- ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td
-
Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td
${CLANG_TBLGEN} -gen-clang-sa-checkers \
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
diff --git a/lib/clang/include/AArch64GenAsmMatcher.inc b/lib/clang/include/AArch64GenAsmMatcher.inc
new file mode 100644
index 000000000000..0b1e0a9b8ffa
--- /dev/null
+++ b/lib/clang/include/AArch64GenAsmMatcher.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AArch64GenAsmMatcher.inc.h"
diff --git a/lib/clang/include/AArch64GenAsmWriter.inc b/lib/clang/include/AArch64GenAsmWriter.inc
new file mode 100644
index 000000000000..20b130b203bb
--- /dev/null
+++ b/lib/clang/include/AArch64GenAsmWriter.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AArch64GenAsmWriter.inc.h"
diff --git a/lib/clang/include/AArch64GenAsmWriter1.inc b/lib/clang/include/AArch64GenAsmWriter1.inc
new file mode 100644
index 000000000000..caf7812fed38
--- /dev/null
+++ b/lib/clang/include/AArch64GenAsmWriter1.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AArch64GenAsmWriter1.inc.h"
diff --git a/lib/clang/include/AArch64GenCallingConv.inc b/lib/clang/include/AArch64GenCallingConv.inc
new file mode 100644
index 000000000000..75bfa38224f8
--- /dev/null
+++ b/lib/clang/include/AArch64GenCallingConv.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AArch64GenCallingConv.inc.h"
diff --git a/lib/clang/include/AArch64GenDAGISel.inc b/lib/clang/include/AArch64GenDAGISel.inc
new file mode 100644
index 000000000000..39bb08455767
--- /dev/null
+++ b/lib/clang/include/AArch64GenDAGISel.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AArch64GenDAGISel.inc.h"
diff --git a/lib/clang/include/AArch64GenDisassemblerTables.inc b/lib/clang/include/AArch64GenDisassemblerTables.inc
new file mode 100644
index 000000000000..3b2633601979
--- /dev/null
+++ b/lib/clang/include/AArch64GenDisassemblerTables.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AArch64GenDisassemblerTables.inc.h"
diff --git a/lib/clang/include/AArch64GenFastISel.inc b/lib/clang/include/AArch64GenFastISel.inc
new file mode 100644
index 000000000000..ebc2ad2d14b8
--- /dev/null
+++ b/lib/clang/include/AArch64GenFastISel.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AArch64GenFastISel.inc.h"
diff --git a/lib/clang/include/AArch64GenInstrInfo.inc b/lib/clang/include/AArch64GenInstrInfo.inc
new file mode 100644
index 000000000000..12e60a92ab24
--- /dev/null
+++ b/lib/clang/include/AArch64GenInstrInfo.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AArch64GenInstrInfo.inc.h"
diff --git a/lib/clang/include/AArch64GenMCCodeEmitter.inc b/lib/clang/include/AArch64GenMCCodeEmitter.inc
new file mode 100644
index 000000000000..e3515f5cda49
--- /dev/null
+++ b/lib/clang/include/AArch64GenMCCodeEmitter.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AArch64GenMCCodeEmitter.inc.h"
diff --git a/lib/clang/include/AArch64GenMCPseudoLowering.inc b/lib/clang/include/AArch64GenMCPseudoLowering.inc
new file mode 100644
index 000000000000..93f3f3a20a2b
--- /dev/null
+++ b/lib/clang/include/AArch64GenMCPseudoLowering.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AArch64GenMCPseudoLowering.inc.h"
diff --git a/lib/clang/include/AArch64GenRegisterInfo.inc b/lib/clang/include/AArch64GenRegisterInfo.inc
new file mode 100644
index 000000000000..a6a9647a14cf
--- /dev/null
+++ b/lib/clang/include/AArch64GenRegisterInfo.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AArch64GenRegisterInfo.inc.h"
diff --git a/lib/clang/include/AArch64GenSubtargetInfo.inc b/lib/clang/include/AArch64GenSubtargetInfo.inc
new file mode 100644
index 000000000000..8674332a2012
--- /dev/null
+++ b/lib/clang/include/AArch64GenSubtargetInfo.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AArch64GenSubtargetInfo.inc.h"
diff --git a/lib/clang/include/Makefile b/lib/clang/include/Makefile
index 1ffd3e1595a3..0e6ac6ea5045 100644
--- a/lib/clang/include/Makefile
+++ b/lib/clang/include/Makefile
@@ -8,13 +8,21 @@ LLVM_SRCS= ${.CURDIR}/../../../contrib/llvm
.PATH: ${LLVM_SRCS}/tools/clang/lib/Headers
-INCSDIR=${INCLUDEDIR}/clang/3.4.1
+INCSDIR=${LIBDIR}/clang/3.6.0/include
-INCS= __wmmintrin_aes.h \
+INCS= __stddef_max_align_t.h \
+ __wmmintrin_aes.h \
__wmmintrin_pclmul.h \
+ adxintrin.h \
altivec.h \
ammintrin.h \
+ arm_acle.h \
avx2intrin.h \
+ avx512bwintrin.h \
+ avx512erintrin.h \
+ avx512fintrin.h \
+ avx512vlbwintrin.h \
+ avx512vlintrin.h \
avxintrin.h \
bmi2intrin.h \
bmiintrin.h \
@@ -23,12 +31,13 @@ INCS= __wmmintrin_aes.h \
f16cintrin.h \
fma4intrin.h \
fmaintrin.h \
+ ia32intrin.h \
immintrin.h \
lzcntintrin.h \
mm3dnow.h \
mm_malloc.h \
mmintrin.h \
- module.map \
+ module.modulemap \
nmmintrin.h \
pmmintrin.h \
popcntintrin.h \
diff --git a/lib/clang/include/MipsGenFastISel.inc b/lib/clang/include/MipsGenFastISel.inc
new file mode 100644
index 000000000000..a2aaacf8a1aa
--- /dev/null
+++ b/lib/clang/include/MipsGenFastISel.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "MipsGenFastISel.inc.h"
diff --git a/lib/clang/include/PPCGenDisassemblerTables.inc b/lib/clang/include/PPCGenDisassemblerTables.inc
new file mode 100644
index 000000000000..c581dbee1c7c
--- /dev/null
+++ b/lib/clang/include/PPCGenDisassemblerTables.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "PPCGenDisassemblerTables.inc.h"
diff --git a/lib/clang/include/clang/AST/AttrVisitor.inc b/lib/clang/include/clang/AST/AttrVisitor.inc
new file mode 100644
index 000000000000..8f8bdb0ec2ca
--- /dev/null
+++ b/lib/clang/include/clang/AST/AttrVisitor.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AttrVisitor.inc.h"
diff --git a/lib/clang/include/clang/Basic/AttrHasAttributeImpl.inc b/lib/clang/include/clang/Basic/AttrHasAttributeImpl.inc
new file mode 100644
index 000000000000..0e996d2d29eb
--- /dev/null
+++ b/lib/clang/include/clang/Basic/AttrHasAttributeImpl.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AttrHasAttributeImpl.inc.h"
diff --git a/lib/clang/include/clang/Basic/Version.inc b/lib/clang/include/clang/Basic/Version.inc
index d2fcc0467053..c6d4a8e4b60d 100644
--- a/lib/clang/include/clang/Basic/Version.inc
+++ b/lib/clang/include/clang/Basic/Version.inc
@@ -1,11 +1,11 @@
/* $FreeBSD$ */
-#define CLANG_VERSION 3.4.1
+#define CLANG_VERSION 3.6.0
#define CLANG_VERSION_MAJOR 3
-#define CLANG_VERSION_MINOR 4
-#define CLANG_VERSION_PATCHLEVEL 1
+#define CLANG_VERSION_MINOR 6
+#define CLANG_VERSION_PATCHLEVEL 0
#define CLANG_VENDOR "FreeBSD "
-#define CLANG_VENDOR_SUFFIX " 20140512"
+#define CLANG_VENDOR_SUFFIX " 20150225"
-#define SVN_REVISION "208032"
+#define SVN_REVISION "230434"
diff --git a/lib/clang/include/clang/Config/config.h b/lib/clang/include/clang/Config/config.h
index 5c35829758ae..9c4512d83ecc 100644
--- a/lib/clang/include/clang/Config/config.h
+++ b/lib/clang/include/clang/Config/config.h
@@ -1,26 +1,39 @@
/* $FreeBSD$ */
/* tools/clang/include/clang/Config/config.h. Generated from config.h.in by configure. */
-/* include/clang/Config/config.h.in. */
+/* This generated file is for internal use. Do not include it from headers. */
-#ifndef CONFIG_H
+#ifdef CONFIG_H
+#error config.h can only be included once
+#else
#define CONFIG_H
/* Bug report URL. */
#define BUG_REPORT_URL "https://bugs.freebsd.org/submit/"
+/* Multilib suffix for libdir. */
+#define CLANG_LIBDIR_SUFFIX ""
+
/* Relative directory for resource files */
#define CLANG_RESOURCE_DIR ""
/* Directories clang will search for headers */
#define C_INCLUDE_DIRS ""
-/* Linker version detected at compile time. */
-/* #undef HOST_LINK_VERSION */
-
/* Default <path> to all compiler invocations for --sysroot=<path>. */
/* #undef DEFAULT_SYSROOT */
/* Directory where gcc is installed. */
#define GCC_INSTALL_PREFIX ""
+/* Define if we have libxml2 */
+/* #undef CLANG_HAVE_LIBXML */
+
+#define PACKAGE_STRING "LLVM 3.6.0"
+
+/* The LLVM product name and version */
+#define BACKEND_PACKAGE_STRING PACKAGE_STRING
+
+/* Linker version detected at compile time. */
+/* #undef HOST_LINK_VERSION */
+
#endif
diff --git a/lib/clang/include/clang/Driver/CC1AsOptions.inc b/lib/clang/include/clang/Driver/CC1AsOptions.inc
deleted file mode 100644
index 3d7695800081..000000000000
--- a/lib/clang/include/clang/Driver/CC1AsOptions.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "CC1AsOptions.inc.h"
diff --git a/lib/clang/include/clang/Lex/AttrSpellings.inc b/lib/clang/include/clang/Lex/AttrSpellings.inc
deleted file mode 100644
index 8859ae34833f..000000000000
--- a/lib/clang/include/clang/Lex/AttrSpellings.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AttrSpellings.inc.h"
diff --git a/lib/clang/include/clang/Parse/AttrIdentifierArg.inc b/lib/clang/include/clang/Parse/AttrIdentifierArg.inc
deleted file mode 100644
index 2969a5057b94..000000000000
--- a/lib/clang/include/clang/Parse/AttrIdentifierArg.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AttrIdentifierArg.inc.h"
diff --git a/lib/clang/include/clang/Parse/AttrLateParsed.inc b/lib/clang/include/clang/Parse/AttrLateParsed.inc
deleted file mode 100644
index 1282d9e188ff..000000000000
--- a/lib/clang/include/clang/Parse/AttrLateParsed.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AttrLateParsed.inc.h"
diff --git a/lib/clang/include/clang/Parse/AttrParserStringSwitches.inc b/lib/clang/include/clang/Parse/AttrParserStringSwitches.inc
new file mode 100644
index 000000000000..ef8642c1af11
--- /dev/null
+++ b/lib/clang/include/clang/Parse/AttrParserStringSwitches.inc
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+#include "AttrParserStringSwitches.inc.h"
diff --git a/lib/clang/include/clang/Parse/AttrTypeArg.inc b/lib/clang/include/clang/Parse/AttrTypeArg.inc
deleted file mode 100644
index 8eb469943108..000000000000
--- a/lib/clang/include/clang/Parse/AttrTypeArg.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-/* $FreeBSD$ */
-#include "AttrTypeArg.inc.h"
diff --git a/lib/clang/include/llvm/Config/AsmParsers.def b/lib/clang/include/llvm/Config/AsmParsers.def
index e0165f0c28e6..3be6e385415c 100644
--- a/lib/clang/include/llvm/Config/AsmParsers.def
+++ b/lib/clang/include/llvm/Config/AsmParsers.def
@@ -1,5 +1,6 @@
/* $FreeBSD$ */
+LLVM_ASM_PARSER(AArch64)
LLVM_ASM_PARSER(ARM)
LLVM_ASM_PARSER(Mips)
LLVM_ASM_PARSER(PowerPC)
diff --git a/lib/clang/include/llvm/Config/AsmPrinters.def b/lib/clang/include/llvm/Config/AsmPrinters.def
index 97ca9521aa02..9ed021771d62 100644
--- a/lib/clang/include/llvm/Config/AsmPrinters.def
+++ b/lib/clang/include/llvm/Config/AsmPrinters.def
@@ -1,5 +1,6 @@
/* $FreeBSD$ */
+LLVM_ASM_PRINTER(AArch64)
LLVM_ASM_PRINTER(ARM)
LLVM_ASM_PRINTER(Mips)
LLVM_ASM_PRINTER(PowerPC)
diff --git a/lib/clang/include/llvm/Config/Disassemblers.def b/lib/clang/include/llvm/Config/Disassemblers.def
index 25406a4ce007..44fc7ef54708 100644
--- a/lib/clang/include/llvm/Config/Disassemblers.def
+++ b/lib/clang/include/llvm/Config/Disassemblers.def
@@ -1,7 +1,9 @@
/* $FreeBSD$ */
+LLVM_DISASSEMBLER(AArch64)
LLVM_DISASSEMBLER(ARM)
LLVM_DISASSEMBLER(Mips)
+LLVM_DISASSEMBLER(PowerPC)
LLVM_DISASSEMBLER(Sparc)
LLVM_DISASSEMBLER(X86)
diff --git a/lib/clang/include/llvm/Config/Targets.def b/lib/clang/include/llvm/Config/Targets.def
index e51e06a0de2b..96b60d9b5101 100644
--- a/lib/clang/include/llvm/Config/Targets.def
+++ b/lib/clang/include/llvm/Config/Targets.def
@@ -1,5 +1,6 @@
/* $FreeBSD$ */
+LLVM_TARGET(AArch64)
LLVM_TARGET(ARM)
LLVM_TARGET(Mips)
LLVM_TARGET(PowerPC)
diff --git a/lib/clang/include/llvm/Config/config.h b/lib/clang/include/llvm/Config/config.h
index ce32c501fe27..3fc38bea7529 100644
--- a/lib/clang/include/llvm/Config/config.h
+++ b/lib/clang/include/llvm/Config/config.h
@@ -14,6 +14,9 @@
/* Define if we have libxml2 */
/* #undef CLANG_HAVE_LIBXML */
+/* Multilib suffix for libdir. */
+/* #undef CLANG_LIBDIR_SUFFIX */
+
/* Relative directory for resource files */
#define CLANG_RESOURCE_DIR ""
@@ -38,39 +41,12 @@
/* Directory where gcc is installed. */
#define GCC_INSTALL_PREFIX ""
-/* Define to 1 if you have the `arc4random' function. */
-#define HAVE_ARC4RANDOM 1
-
-/* Define to 1 if you have the `argz_append' function. */
-/* #undef HAVE_ARGZ_APPEND */
-
-/* Define to 1 if you have the `argz_create_sep' function. */
-/* #undef HAVE_ARGZ_CREATE_SEP */
-
-/* Define to 1 if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define to 1 if you have the `argz_insert' function. */
-/* #undef HAVE_ARGZ_INSERT */
-
-/* Define to 1 if you have the `argz_next' function. */
-/* #undef HAVE_ARGZ_NEXT */
-
-/* Define to 1 if you have the `argz_stringify' function. */
-/* #undef HAVE_ARGZ_STRINGIFY */
-
/* Define to 1 if you have the `backtrace' function. */
/* #undef HAVE_BACKTRACE */
/* Define to 1 if you have the `ceilf' function. */
#define HAVE_CEILF 1
-/* Define if the neat program is available */
-/* #undef HAVE_CIRCO */
-
-/* Define to 1 if you have the `closedir' function. */
-#define HAVE_CLOSEDIR 1
-
/* Define to 1 if you have the <CrashReporterClient.h> header file. */
/* #undef HAVE_CRASHREPORTERCLIENT_H */
@@ -80,6 +56,10 @@
/* Define to 1 if you have the <cxxabi.h> header file. */
#define HAVE_CXXABI_H 1
+/* Define to 1 if you have the declaration of `arc4random', and to 0 if you
+ don't. */
+#define HAVE_DECL_ARC4RANDOM 1
+
/* Define to 1 if you have the declaration of `FE_ALL_EXCEPT', and to 0 if you
don't. */
#define HAVE_DECL_FE_ALL_EXCEPT 1
@@ -96,12 +76,6 @@
*/
#define HAVE_DIRENT_H 1
-/* Define if you have the GNU dld library. */
-/* #undef HAVE_DLD */
-
-/* Define to 1 if you have the `dlerror' function. */
-#define HAVE_DLERROR 1
-
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
@@ -111,20 +85,13 @@
/* Define if the dot program is available */
/* #undef HAVE_DOT */
-/* Define if the dotty program is available */
-/* #undef HAVE_DOTTY */
-
-/* Define if you have the _dyld_func_lookup function. */
-/* #undef HAVE_DYLD */
-
/* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1
-/* Define to 1 if the system has the type `error_t'. */
-/* #undef HAVE_ERROR_T */
-
/* Define to 1 if you have the <execinfo.h> header file. */
-/* #undef HAVE_EXECINFO_H */
+#if __FreeBSD_version >= 1000052
+#define HAVE_EXECINFO_H 1
+#endif
/* Define to 1 if you have the `exp' function. */
#define HAVE_EXP 1
@@ -135,9 +102,6 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
-/* Define if the neat program is available */
-/* #undef HAVE_FDP */
-
/* Define to 1 if you have the <fenv.h> header file. */
#define HAVE_FENV_H 1
@@ -160,7 +124,9 @@
#define HAVE_FMODF 1
/* Define to 1 if you have the `futimens' function. */
-/* #undef HAVE_FUTIMENS */
+#if __FreeBSD_version >= 1100056
+#define HAVE_FUTIMENS 1
+#endif
/* Define to 1 if you have the `futimes' function. */
#define HAVE_FUTIMES 1
@@ -180,12 +146,6 @@
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
-/* Define if the Graphviz program is available */
-/* #undef HAVE_GRAPHVIZ */
-
-/* Define if the gv program is available */
-/* #undef HAVE_GV */
-
/* Define to 1 if the system has the type `int64_t'. */
#define HAVE_INT64_T 1
@@ -207,8 +167,8 @@
/* Set to 1 if the isnan function is found in <math.h> */
#define HAVE_ISNAN_IN_MATH_H 1
-/* Define if you have the libdl library or equivalent. */
-#define HAVE_LIBDL 1
+/* Define if libedit is available on this platform. */
+#define HAVE_LIBEDIT 1
/* Define to 1 if you have the `imagehlp' library (-limagehlp). */
/* #undef HAVE_LIBIMAGEHLP */
@@ -225,9 +185,6 @@
/* Define to 1 if you have the `shell32' library (-lshell32). */
/* #undef HAVE_LIBSHELL32 */
-/* Define to 1 if you have the `udis86' library (-ludis86). */
-/* #undef HAVE_LIBUDIS86 */
-
/* Define to 1 if you have the `z' library (-lz). */
#define HAVE_LIBZ 1
@@ -258,9 +215,6 @@
/* Define to 1 if you have the <mach/mach.h> header file. */
/* #undef HAVE_MACH_MACH_H */
-/* Define to 1 if you have the <mach-o/dyld.h> header file. */
-/* #undef HAVE_MACH_O_DYLD_H */
-
/* Define if mallinfo() is available on this platform. */
/* #undef HAVE_MALLINFO */
@@ -301,12 +255,6 @@
/* Define to 1 if you have the `nearbyintf' function. */
#define HAVE_NEARBYINTF 1
-/* Define if the neat program is available */
-/* #undef HAVE_NEATO */
-
-/* Define to 1 if you have the `opendir' function. */
-#define HAVE_OPENDIR 1
-
/* Define to 1 if you have the `posix_spawn' function. */
/* #undef HAVE_POSIX_SPAWN */
@@ -316,9 +264,6 @@
/* Define to 1 if you have the `pread' function. */
#define HAVE_PREAD 1
-/* Define if libtool can extract symbol lists from object files. */
-#define HAVE_PRELOADED_SYMBOLS 1
-
/* Define to have the %a format string */
#define HAVE_PRINTF_A 1
@@ -337,9 +282,6 @@
/* Define to 1 if srand48/lrand48/drand48 exist in <stdlib.h> */
#define HAVE_RAND48 1
-/* Define to 1 if you have the `readdir' function. */
-#define HAVE_READDIR 1
-
/* Define to 1 if you have the `realpath' function. */
#define HAVE_REALPATH 1
@@ -367,9 +309,6 @@
/* Define to 1 if you have the `setrlimit' function. */
#define HAVE_SETRLIMIT 1
-/* Define if you have the shl_load function. */
-/* #undef HAVE_SHL_LOAD */
-
/* Define to 1 if you have the `siglongjmp' function. */
#define HAVE_SIGLONGJMP 1
@@ -456,9 +395,6 @@
/* Define to 1 if you have the <termios.h> header file. */
#define HAVE_TERMIOS_H 1
-/* Define if the neat program is available */
-/* #undef HAVE_TWOPI */
-
/* Define to 1 if the system has the type `uint64_t'. */
#define HAVE_UINT64_T 1
@@ -477,9 +413,6 @@
/* Define to 1 if you have the `writev' function. */
#define HAVE_WRITEV 1
-/* Define if the xdot program is available */
-/* #undef HAVE_XDOT */
-
/* Define to 1 if you have the <zlib.h> header file. */
#define HAVE_ZLIB_H 1
@@ -603,33 +536,9 @@
/* Define if this is Win32ish platform */
/* #undef LLVM_ON_WIN32 */
-/* Define to path to circo program if found or 'echo circo' otherwise */
-/* #undef LLVM_PATH_CIRCO */
-
/* Define to path to dot program if found or 'echo dot' otherwise */
/* #undef LLVM_PATH_DOT */
-/* Define to path to dotty program if found or 'echo dotty' otherwise */
-/* #undef LLVM_PATH_DOTTY */
-
-/* Define to path to fdp program if found or 'echo fdp' otherwise */
-/* #undef LLVM_PATH_FDP */
-
-/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */
-/* #undef LLVM_PATH_GRAPHVIZ */
-
-/* Define to path to gv program if found or 'echo gv' otherwise */
-/* #undef LLVM_PATH_GV */
-
-/* Define to path to neato program if found or 'echo neato' otherwise */
-/* #undef LLVM_PATH_NEATO */
-
-/* Define to path to twopi program if found or 'echo twopi' otherwise */
-/* #undef LLVM_PATH_TWOPI */
-
-/* Define to path to xdot program if found or 'echo xdot' otherwise */
-/* #undef LLVM_PATH_XDOT */
-
/* Installation prefix directory */
#define LLVM_PREFIX "/usr"
@@ -643,45 +552,35 @@
#define LLVM_VERSION_MAJOR 3
/* Minor version of the LLVM API */
-#define LLVM_VERSION_MINOR 4
+#define LLVM_VERSION_MINOR 6
/* Patch version of the LLVM API */
-#define LLVM_VERSION_PATCH 1
-
-/* Define if the OS needs help to load dependent libraries for dlopen(). */
-#define LTDL_DLOPEN_DEPLIBS 1
+#define LLVM_VERSION_PATCH 0
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
-#define LTDL_OBJDIR ".libs/"
+/* LLVM version string */
+#define LLVM_VERSION_STRING "3.6.0"
-/* Define to the extension used for shared libraries, say, ".so". */
+/* The shared library extension */
#define LTDL_SHLIB_EXT ".so"
-/* Define to the system default library search path. */
-#define LTDL_SYSSEARCHPATH "/lib:/usr/lib"
-
/* Define if /dev/zero should be used when mapping RWX memory, or undefine if
its not necessary */
/* #undef NEED_DEV_ZERO_FOR_MMAP */
-/* Define if dlsym() requires a leading underscore in symbol names. */
-/* #undef NEED_USCORE */
-
/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "http://llvm.org/bugs/"
+#define PACKAGE_BUGREPORT "https://bugs.freebsd.org/submit/"
/* Define to the full name of this package. */
#define PACKAGE_NAME "LLVM"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "LLVM 3.4.1"
+#define PACKAGE_STRING "LLVM 3.6.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "llvm"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "3.4.1"
+#define PACKAGE_VERSION "3.6.0"
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
@@ -698,18 +597,9 @@
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */
-/* Define if use udis86 library */
-#define USE_UDIS86 0
-
/* Type of 1st arg on ELM Callback */
/* #undef WIN32_ELMCB_PCSTR */
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
-
-/* Define to a type to use for `error_t' if it is not otherwise available. */
-#define error_t int
-
/* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */
diff --git a/lib/clang/include/llvm/Config/llvm-config.h b/lib/clang/include/llvm/Config/llvm-config.h
index 1717863779a0..ba952630d7b7 100644
--- a/lib/clang/include/llvm/Config/llvm-config.h
+++ b/lib/clang/include/llvm/Config/llvm-config.h
@@ -1,6 +1,6 @@
/* $FreeBSD$ */
/* include/llvm/Config/llvm-config.h. Generated from llvm-config.h.in by configure. */
-/*===-- llvm/config/llvm-config.h - llvm configure variable -------*- C -*-===*/
+/*===------- llvm/Config/llvm-config.h - llvm configuration -------*- C -*-===*/
/* */
/* The LLVM Compiler Infrastructure */
/* */
@@ -9,14 +9,12 @@
/* */
/*===----------------------------------------------------------------------===*/
-/* This file enumerates all of the llvm variables from configure so that
- they can be in exported headers and won't override package specific
- directives. This is a C file so we can include it in the llvm-c headers. */
+/* This file enumerates variables from the LLVM configuration so that they
+ can be in exported headers and won't override package specific directives.
+ This is a C header that can be included in the llvm-c headers. */
-/* To avoid multiple inclusions of these variables when we include the exported
- headers and config.h, conditionally include these. */
-/* TODO: This is a bit of a hack. */
-#ifndef CONFIG_H
+#ifndef LLVM_CONFIG_H
+#define LLVM_CONFIG_H
/* Installation directory for binary executables */
/* #undef LLVM_BINDIR */
@@ -81,33 +79,6 @@
/* Define if this is Win32ish platform */
/* #undef LLVM_ON_WIN32 */
-/* Define to path to circo program if found or 'echo circo' otherwise */
-/* #undef LLVM_PATH_CIRCO */
-
-/* Define to path to dot program if found or 'echo dot' otherwise */
-/* #undef LLVM_PATH_DOT */
-
-/* Define to path to dotty program if found or 'echo dotty' otherwise */
-/* #undef LLVM_PATH_DOTTY */
-
-/* Define to path to fdp program if found or 'echo fdp' otherwise */
-/* #undef LLVM_PATH_FDP */
-
-/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */
-/* #undef LLVM_PATH_GRAPHVIZ */
-
-/* Define to path to gv program if found or 'echo gv' otherwise */
-/* #undef LLVM_PATH_GV */
-
-/* Define to path to neato program if found or 'echo neato' otherwise */
-/* #undef LLVM_PATH_NEATO */
-
-/* Define to path to twopi program if found or 'echo twopi' otherwise */
-/* #undef LLVM_PATH_TWOPI */
-
-/* Define to path to xdot.py program if found or 'echo xdot.py' otherwise */
-/* #undef LLVM_PATH_XDOT_PY */
-
/* Installation prefix directory */
#define LLVM_PREFIX "/usr"
@@ -121,6 +92,12 @@
#define LLVM_VERSION_MAJOR 3
/* Minor version of the LLVM API */
-#define LLVM_VERSION_MINOR 4
+#define LLVM_VERSION_MINOR 6
+
+/* Patch version of the LLVM API */
+#define LLVM_VERSION_PATCH 0
+
+/* LLVM version string */
+#define LLVM_VERSION_STRING "3.6.0"
#endif
diff --git a/lib/clang/include/llvm/Support/DataTypes.h b/lib/clang/include/llvm/Support/DataTypes.h
index d0fdb7cae550..6f95bc413ac1 100644
--- a/lib/clang/include/llvm/Support/DataTypes.h
+++ b/lib/clang/include/llvm/Support/DataTypes.h
@@ -1,6 +1,6 @@
/* $FreeBSD$ */
/* include/llvm/Support/DataTypes.h. Generated from DataTypes.h.in by configure. */
-/*===-- include/System/DataTypes.h - Define fixed size types -----*- C -*-===*\
+/*===-- include/Support/DataTypes.h - Define fixed size types -----*- C -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
@@ -23,10 +23,11 @@
/* Please leave this file C-compatible. */
+/* Please keep this file in sync with DataTypes.h.cmake */
+
#ifndef SUPPORT_DATATYPES_H
#define SUPPORT_DATATYPES_H
-#define HAVE_SYS_TYPES_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UINT64_T 1
@@ -38,31 +39,33 @@
#include <math.h>
#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#else
+#error "Compiler must provide an implementation of stdint.h"
+#endif
+
+#ifndef _MSC_VER
+
/* Note that this header's correct operation depends on __STDC_LIMIT_MACROS
being defined. We would define it here, but in order to prevent Bad Things
happening when system headers or C++ STL headers include stdint.h before we
define it here, we define it on the g++ command line (in Makefile.rules). */
#if !defined(__STDC_LIMIT_MACROS)
-# error "Must #define __STDC_LIMIT_MACROS before #including System/DataTypes.h"
+# error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
#endif
#if !defined(__STDC_CONSTANT_MACROS)
# error "Must #define __STDC_CONSTANT_MACROS before " \
- "#including System/DataTypes.h"
+ "#including Support/DataTypes.h"
#endif
/* Note that <inttypes.h> includes <stdint.h>, if this is a C99 system. */
-#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
-#endif
-
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
#ifdef _AIX
#include "llvm/Support/AIXDataTypesFix.h"
@@ -77,18 +80,33 @@ typedef u_int64_t uint64_t;
#endif
#endif
-#ifdef _OpenBSD_
-#define INT8_MAX 127
-#define INT8_MIN -128
-#define UINT8_MAX 255
-#define INT16_MAX 32767
-#define INT16_MIN -32768
-#define UINT16_MAX 65535
-#define INT32_MAX 2147483647
-#define INT32_MIN -2147483648
-#define UINT32_MAX 4294967295U
+#else /* _MSC_VER */
+#include <stdlib.h>
+#include <stddef.h>
+#include <sys/types.h>
+#ifdef __cplusplus
+#include <cmath>
+#else
+#include <math.h>
#endif
+#if defined(_WIN64)
+typedef signed __int64 ssize_t;
+#else
+typedef signed int ssize_t;
+#endif /* _WIN64 */
+
+#ifndef HAVE_INTTYPES_H
+#define PRId64 "I64d"
+#define PRIi64 "I64i"
+#define PRIo64 "I64o"
+#define PRIu64 "I64u"
+#define PRIx64 "I64x"
+#define PRIX64 "I64X"
+#endif /* HAVE_INTTYPES_H */
+
+#endif /* _MSC_VER */
+
/* Set defaults for constants which we cannot find. */
#if !defined(INT64_MAX)
# define INT64_MAX 9223372036854775807LL
@@ -100,12 +118,6 @@ typedef u_int64_t uint64_t;
# define UINT64_MAX 0xffffffffffffffffULL
#endif
-#if __GNUC__ > 3
-#define END_WITH_NULL __attribute__((sentinel))
-#else
-#define END_WITH_NULL
-#endif
-
#ifndef HUGE_VALF
#define HUGE_VALF (float)HUGE_VAL
#endif
diff --git a/lib/clang/libclanganalysis/Makefile b/lib/clang/libclanganalysis/Makefile
index f71b689f117a..6a34dcabf2ec 100644
--- a/lib/clang/libclanganalysis/Makefile
+++ b/lib/clang/libclanganalysis/Makefile
@@ -12,6 +12,7 @@ SRCS= AnalysisDeclContext.cpp \
CFGStmtMap.cpp \
CallGraph.cpp \
CocoaConventions.cpp \
+ CodeInjector.cpp \
Consumed.cpp \
Dominators.cpp \
FormatString.cpp \
@@ -24,9 +25,13 @@ SRCS= AnalysisDeclContext.cpp \
ReachableCode.cpp \
ScanfFormatString.cpp \
ThreadSafety.cpp \
+ ThreadSafetyCommon.cpp \
+ ThreadSafetyLogical.cpp \
+ ThreadSafetyTIL.cpp \
UninitializedValues.cpp
TGHDRS= AttrList \
+ AttrVisitor \
Attrs \
CommentCommandList \
CommentNodes \
diff --git a/lib/clang/libclangarcmigrate/Makefile b/lib/clang/libclangarcmigrate/Makefile
index 1604a50b5003..a6b06c4a418e 100644
--- a/lib/clang/libclangarcmigrate/Makefile
+++ b/lib/clang/libclangarcmigrate/Makefile
@@ -28,6 +28,7 @@ SRCS= ARCMT.cpp \
TGHDRS= AttrList \
AttrParsedAttrList \
+ AttrVisitor \
Attrs \
CommentCommandList \
CommentNodes \
diff --git a/lib/clang/libclangast/Makefile b/lib/clang/libclangast/Makefile
index 71cd684b007a..a3f00aa00bd3 100644
--- a/lib/clang/libclangast/Makefile
+++ b/lib/clang/libclangast/Makefile
@@ -39,7 +39,6 @@ SRCS= APValue.cpp \
ItaniumCXXABI.cpp \
ItaniumMangle.cpp \
Mangle.cpp \
- MangleNumberingContext.cpp \
MicrosoftCXXABI.cpp \
MicrosoftMangle.cpp \
NSAPI.cpp \
@@ -65,6 +64,7 @@ SRCS= APValue.cpp \
TGHDRS= AttrDump \
AttrImpl \
AttrList \
+ AttrVisitor \
Attrs \
CommentCommandInfo \
CommentCommandList \
@@ -76,6 +76,7 @@ TGHDRS= AttrDump \
DiagnosticASTKinds \
DiagnosticCommentKinds \
DiagnosticCommonKinds \
+ DiagnosticFrontendKinds \
DiagnosticSemaKinds \
StmtNodes
diff --git a/lib/clang/libclangbasic/Makefile b/lib/clang/libclangbasic/Makefile
index 16bae4c39387..6a5791c1bc0c 100644
--- a/lib/clang/libclangbasic/Makefile
+++ b/lib/clang/libclangbasic/Makefile
@@ -5,7 +5,8 @@
LIB= clangbasic
SRCDIR= tools/clang/lib/Basic
-SRCS= Builtins.cpp \
+SRCS= Attributes.cpp \
+ Builtins.cpp \
CharInfo.cpp \
Diagnostic.cpp \
DiagnosticIDs.cpp \
@@ -17,15 +18,20 @@ SRCS= Builtins.cpp \
ObjCRuntime.cpp \
OpenMPKinds.cpp \
OperatorPrecedence.cpp \
+ SanitizerBlacklist.cpp \
+ Sanitizers.cpp \
SourceLocation.cpp \
SourceManager.cpp \
TargetInfo.cpp \
Targets.cpp \
TokenKinds.cpp \
Version.cpp \
- VersionTuple.cpp
+ VersionTuple.cpp \
+ VirtualFileSystem.cpp \
+ Warnings.cpp
-TGHDRS= DiagnosticAnalysisKinds \
+TGHDRS= AttrHasAttributeImpl \
+ DiagnosticAnalysisKinds \
DiagnosticASTKinds \
DiagnosticCommentKinds \
DiagnosticCommonKinds \
diff --git a/lib/clang/libclangcodegen/Makefile b/lib/clang/libclangcodegen/Makefile
index 3b45f6bd52cd..521a430de22e 100644
--- a/lib/clang/libclangcodegen/Makefile
+++ b/lib/clang/libclangcodegen/Makefile
@@ -26,29 +26,35 @@ SRCS= BackendUtil.cpp \
CGExprComplex.cpp \
CGExprConstant.cpp \
CGExprScalar.cpp \
+ CGLoopInfo.cpp \
CGObjC.cpp \
CGObjCGNU.cpp \
CGObjCMac.cpp \
CGObjCRuntime.cpp \
CGOpenCLRuntime.cpp \
- CGRTTI.cpp \
+ CGOpenMPRuntime.cpp \
CGRecordLayoutBuilder.cpp \
CGStmt.cpp \
+ CGStmtOpenMP.cpp \
CGVTT.cpp \
CGVTables.cpp \
CodeGenABITypes.cpp \
CodeGenAction.cpp \
CodeGenFunction.cpp \
CodeGenModule.cpp \
+ CodeGenPGO.cpp \
CodeGenTBAA.cpp \
CodeGenTypes.cpp \
+ CoverageMappingGen.cpp \
ItaniumCXXABI.cpp \
MicrosoftCXXABI.cpp \
- MicrosoftVBTables.cpp \
ModuleBuilder.cpp \
+ SanitizerMetadata.cpp \
TargetInfo.cpp
TGHDRS= AttrList \
+ AttrParsedAttrList \
+ AttrVisitor \
Attrs \
CommentCommandList \
CommentNodes \
diff --git a/lib/clang/libclangdriver/Makefile b/lib/clang/libclangdriver/Makefile
index 91a8f6156705..aa51384a0764 100644
--- a/lib/clang/libclangdriver/Makefile
+++ b/lib/clang/libclangdriver/Makefile
@@ -6,22 +6,22 @@ LIB= clangdriver
SRCDIR= tools/clang/lib/Driver
SRCS= Action.cpp \
- CC1AsOptions.cpp \
Compilation.cpp \
+ CrossWindowsToolChain.cpp \
Driver.cpp \
DriverOptions.cpp \
Job.cpp \
+ MSVCToolChain.cpp \
+ Multilib.cpp \
Phases.cpp \
SanitizerArgs.cpp \
Tool.cpp \
ToolChain.cpp \
ToolChains.cpp \
Tools.cpp \
- Types.cpp \
- WindowsToolChain.cpp
+ Types.cpp
-TGHDRS= CC1AsOptions \
- DiagnosticCommonKinds \
+TGHDRS= DiagnosticCommonKinds \
DiagnosticDriverKinds \
DiagnosticSemaKinds \
Options
diff --git a/lib/clang/libclangfrontend/Makefile b/lib/clang/libclangfrontend/Makefile
index 4ea35565554d..95b8fc873219 100644
--- a/lib/clang/libclangfrontend/Makefile
+++ b/lib/clang/libclangfrontend/Makefile
@@ -11,6 +11,7 @@ SRCS= ASTConsumers.cpp \
CacheTokens.cpp \
ChainedDiagnosticConsumer.cpp \
ChainedIncludesSource.cpp \
+ CodeGenOptions.cpp \
CompilerInstance.cpp \
CompilerInvocation.cpp \
CreateInvocationFromCommandLine.cpp \
@@ -26,17 +27,19 @@ SRCS= ASTConsumers.cpp \
LangStandards.cpp \
LayoutOverrideSource.cpp \
LogDiagnosticPrinter.cpp \
+ ModuleDependencyCollector.cpp \
MultiplexConsumer.cpp \
PrintPreprocessedOutput.cpp \
SerializedDiagnosticPrinter.cpp \
+ SerializedDiagnosticReader.cpp \
TextDiagnostic.cpp \
TextDiagnosticBuffer.cpp \
TextDiagnosticPrinter.cpp \
- VerifyDiagnosticConsumer.cpp \
- Warnings.cpp
+ VerifyDiagnosticConsumer.cpp
TGHDRS= AttrList \
AttrParsedAttrList \
+ AttrVisitor \
Attrs \
CommentCommandList \
CommentNodes \
diff --git a/lib/clang/libclangfrontendtool/Makefile b/lib/clang/libclangfrontendtool/Makefile
index f20aa35a11a8..0d71d55e3d74 100644
--- a/lib/clang/libclangfrontendtool/Makefile
+++ b/lib/clang/libclangfrontendtool/Makefile
@@ -7,8 +7,11 @@ LIB= clangfrontendtool
SRCDIR= tools/clang/lib/FrontendTool
SRCS= ExecuteCompilerInvocation.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= CommentCommandList \
+ DeclNodes \
+ DiagnosticCommonKinds \
DiagnosticFrontendKinds \
- Options
+ Options \
+ StmtNodes
.include "../clang.lib.mk"
diff --git a/lib/clang/libclanglex/Makefile b/lib/clang/libclanglex/Makefile
index 3a2873faaed0..90b1fcaa6f97 100644
--- a/lib/clang/libclanglex/Makefile
+++ b/lib/clang/libclanglex/Makefile
@@ -28,7 +28,7 @@ SRCS= HeaderMap.cpp \
TokenConcatenation.cpp \
TokenLexer.cpp
-TGHDRS= AttrSpellings \
+TGHDRS= AttrSpellingListIndex \
DiagnosticCommonKinds \
DiagnosticLexKinds
diff --git a/lib/clang/libclangparse/Makefile b/lib/clang/libclangparse/Makefile
index b204d87370af..e690d66cd6cb 100644
--- a/lib/clang/libclangparse/Makefile
+++ b/lib/clang/libclangparse/Makefile
@@ -16,15 +16,14 @@ SRCS= ParseAST.cpp \
ParseOpenMP.cpp \
ParsePragma.cpp \
ParseStmt.cpp \
+ ParseStmtAsm.cpp \
ParseTemplate.cpp \
ParseTentative.cpp \
Parser.cpp
-TGHDRS= AttrIdentifierArg \
- AttrLateParsed \
- AttrList \
+TGHDRS= AttrList \
AttrParsedAttrList \
- AttrTypeArg \
+ AttrParserStringSwitches \
Attrs \
CommentCommandList \
CommentNodes \
diff --git a/lib/clang/libclangrewritecore/Makefile b/lib/clang/libclangrewrite/Makefile
index 80115ee01891..ec770c3fee37 100644
--- a/lib/clang/libclangrewritecore/Makefile
+++ b/lib/clang/libclangrewrite/Makefile
@@ -2,9 +2,9 @@
.include <bsd.own.mk>
-LIB= clangrewritecore
+LIB= clangrewrite
-SRCDIR= tools/clang/lib/Rewrite/Core
+SRCDIR= tools/clang/lib/Rewrite
SRCS= DeltaTree.cpp \
HTMLRewrite.cpp \
RewriteRope.cpp \
diff --git a/lib/clang/libclangrewritecore/Makefile.depend b/lib/clang/libclangrewrite/Makefile.depend
index a211b19844a9..ef170d1d6f69 100644
--- a/lib/clang/libclangrewritecore/Makefile.depend
+++ b/lib/clang/libclangrewrite/Makefile.depend
@@ -16,10 +16,6 @@ DIRDEPS = \
# local dependencies - needed for -jN in clean tree
HTMLRewrite.o: DiagnosticCommonKinds.inc.h
HTMLRewrite.po: DiagnosticCommonKinds.inc.h
-Rewriter.o: DeclNodes.inc.h
Rewriter.o: DiagnosticCommonKinds.inc.h
-Rewriter.o: StmtNodes.inc.h
-Rewriter.po: DeclNodes.inc.h
Rewriter.po: DiagnosticCommonKinds.inc.h
-Rewriter.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/libclangrewritefrontend/Makefile b/lib/clang/libclangrewritefrontend/Makefile
index 8c41669f89c2..2f614fb366ab 100644
--- a/lib/clang/libclangrewritefrontend/Makefile
+++ b/lib/clang/libclangrewritefrontend/Makefile
@@ -4,14 +4,12 @@
LIB= clangrewritefrontend
-SRCDIR= tools/clang/lib/Rewrite/Frontend
+SRCDIR= tools/clang/lib/Frontend/Rewrite
SRCS= FixItRewriter.cpp \
FrontendActions.cpp \
HTMLPrint.cpp \
InclusionRewriter.cpp \
RewriteMacros.cpp \
- RewriteModernObjC.cpp \
- RewriteObjC.cpp \
RewriteTest.cpp
TGHDRS= AttrList \
diff --git a/lib/clang/libclangsema/Makefile b/lib/clang/libclangsema/Makefile
index 9157b4666aba..08c120a380df 100644
--- a/lib/clang/libclangsema/Makefile
+++ b/lib/clang/libclangsema/Makefile
@@ -18,6 +18,7 @@ SRCS= AnalysisBasedWarnings.cpp \
Sema.cpp \
SemaAccess.cpp \
SemaAttr.cpp \
+ SemaCUDA.cpp \
SemaCXXScopeSpec.cpp \
SemaCast.cpp \
SemaChecking.cpp \
@@ -49,7 +50,6 @@ SRCS= AnalysisBasedWarnings.cpp \
SemaTemplateInstantiateDecl.cpp \
SemaTemplateVariadic.cpp \
SemaType.cpp \
- TargetAttributesSema.cpp \
TypeLocBuilder.cpp
TGHDRS= AttrList \
@@ -58,6 +58,7 @@ TGHDRS= AttrList \
AttrParsedAttrList \
AttrSpellingListIndex \
AttrTemplateInstantiate \
+ AttrVisitor \
Attrs \
CommentCommandList \
CommentNodes \
diff --git a/lib/clang/libclangstaticanalyzercheckers/Makefile b/lib/clang/libclangstaticanalyzercheckers/Makefile
index db27182a7f41..5fb10352c95c 100644
--- a/lib/clang/libclangstaticanalyzercheckers/Makefile
+++ b/lib/clang/libclangstaticanalyzercheckers/Makefile
@@ -33,7 +33,6 @@ SRCS= AllocationDiagnostics.cpp \
ExprInspectionChecker.cpp \
FixedAddressChecker.cpp \
GenericTaintChecker.cpp \
- IdempotentOperationChecker.cpp \
IdenticalExprChecker.cpp \
IvarInvalidationChecker.cpp \
LLVMConventionsChecker.cpp \
@@ -62,6 +61,7 @@ SRCS= AllocationDiagnostics.cpp \
StackAddrEscapeChecker.cpp \
StreamChecker.cpp \
TaintTesterChecker.cpp \
+ TestAfterDivZeroChecker.cpp \
TraversalChecker.cpp \
UndefBranchChecker.cpp \
UndefCapturedBlockVarChecker.cpp \
@@ -74,6 +74,7 @@ SRCS= AllocationDiagnostics.cpp \
VirtualCallChecker.cpp
TGHDRS= AttrList \
+ AttrVisitor \
Attrs \
Checkers \
CommentCommandList \
diff --git a/lib/clang/libclangstaticanalyzerfrontend/Makefile b/lib/clang/libclangstaticanalyzerfrontend/Makefile
index de7b326a073c..397550901ede 100644
--- a/lib/clang/libclangstaticanalyzerfrontend/Makefile
+++ b/lib/clang/libclangstaticanalyzerfrontend/Makefile
@@ -7,9 +7,13 @@ LIB= clangstaticanalyzerfrontend
SRCDIR= tools/clang/lib/StaticAnalyzer/Frontend
SRCS= AnalysisConsumer.cpp \
CheckerRegistration.cpp \
- FrontendActions.cpp
+ ModelConsumer.cpp \
+ FrontendActions.cpp \
+ ModelInjector.cpp
TGHDRS= AttrList \
+ AttrParsedAttrList \
+ AttrVisitor \
Attrs \
Checkers \
CommentCommandList \
diff --git a/lib/clang/liblldb/Makefile b/lib/clang/liblldb/Makefile
index cba14e75632f..1306cdf9c567 100644
--- a/lib/clang/liblldb/Makefile
+++ b/lib/clang/liblldb/Makefile
@@ -10,7 +10,9 @@ SRCDIR= tools/lldb/source
SRCS= lldb.cpp \
lldb-log.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbAPI/Makefile b/lib/clang/liblldbAPI/Makefile
index d041d092182b..44addcaafe8d 100644
--- a/lib/clang/liblldbAPI/Makefile
+++ b/lib/clang/liblldbAPI/Makefile
@@ -19,6 +19,7 @@ SRCS= SBAddress.cpp \
SBDeclaration.cpp \
SBError.cpp \
SBEvent.cpp \
+ SBExecutionContext.cpp \
SBExpressionOptions.cpp \
SBFileSpec.cpp \
SBFileSpecList.cpp \
@@ -43,19 +44,25 @@ SRCS= SBAddress.cpp \
SBSymbolContext.cpp \
SBSymbolContextList.cpp \
SBTarget.cpp \
+ SBThreadCollection.cpp \
+ SBThreadPlan.cpp \
SBThread.cpp \
SBType.cpp \
SBTypeCategory.cpp \
+ SBTypeEnumMember.cpp \
SBTypeFilter.cpp \
SBTypeFormat.cpp \
SBTypeNameSpecifier.cpp \
SBTypeSummary.cpp \
SBTypeSynthetic.cpp \
+ SBUnixSignals.cpp \
SBValue.cpp \
SBValueList.cpp \
SBWatchpoint.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbBreakpoint/Makefile b/lib/clang/liblldbBreakpoint/Makefile
index 396b0aa6103d..b6885d83484e 100644
--- a/lib/clang/liblldbBreakpoint/Makefile
+++ b/lib/clang/liblldbBreakpoint/Makefile
@@ -27,7 +27,9 @@ SRCS= Breakpoint.cpp \
WatchpointList.cpp \
WatchpointOptions.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbCommands/Makefile b/lib/clang/liblldbCommands/Makefile
index f7baf8397a28..833c8a8379ed 100644
--- a/lib/clang/liblldbCommands/Makefile
+++ b/lib/clang/liblldbCommands/Makefile
@@ -34,7 +34,9 @@ SRCS= CommandCompletions.cpp \
CommandObjectWatchpoint.cpp \
CommandObjectWatchpointCommand.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbCore/Makefile b/lib/clang/liblldbCore/Makefile
index e0335f4e3a9a..7d9e86baaf4a 100644
--- a/lib/clang/liblldbCore/Makefile
+++ b/lib/clang/liblldbCore/Makefile
@@ -15,7 +15,6 @@ SRCS= Address.cpp \
Broadcaster.cpp \
Communication.cpp \
Connection.cpp \
- ConnectionFileDescriptor.cpp \
ConnectionMachPort.cpp \
ConnectionSharedMemory.cpp \
ConstString.cpp \
@@ -29,6 +28,7 @@ SRCS= Address.cpp \
EmulateInstruction.cpp \
Error.cpp \
Event.cpp \
+ FastDemangle.cpp \
FileLineResolver.cpp \
FileSpecList.cpp \
History.cpp \
@@ -56,6 +56,7 @@ SRCS= Address.cpp \
StreamGDBRemote.cpp \
StreamString.cpp \
StringList.cpp \
+ StructuredData.cpp \
Timer.cpp \
UserID.cpp \
UserSettingsController.cpp \
@@ -75,7 +76,9 @@ SRCS= Address.cpp \
ValueObjectVariable.cpp \
VMRange.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbDataFormatters/Makefile b/lib/clang/liblldbDataFormatters/Makefile
index b224215ba90a..df34f0000757 100644
--- a/lib/clang/liblldbDataFormatters/Makefile
+++ b/lib/clang/liblldbDataFormatters/Makefile
@@ -13,21 +13,28 @@ SRCS= CF.cpp \
FormatClasses.cpp \
FormatManager.cpp \
LibCxx.cpp \
+ LibCxxInitializerList.cpp \
LibCxxList.cpp \
LibCxxMap.cpp \
LibCxxUnorderedMap.cpp \
+ LibCxxVector.cpp \
LibStdcpp.cpp \
NSArray.cpp \
NSDictionary.cpp \
+ NSIndexPath.cpp \
NSSet.cpp \
+ StringPrinter.cpp \
TypeCategory.cpp \
TypeCategoryMap.cpp \
TypeFormat.cpp \
TypeSummary.cpp \
TypeSynthetic.cpp \
+ TypeValidator.cpp \
ValueObjectPrinter.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbExpression/Makefile b/lib/clang/liblldbExpression/Makefile
index 120add5693ee..d2d822bc7eb1 100644
--- a/lib/clang/liblldbExpression/Makefile
+++ b/lib/clang/liblldbExpression/Makefile
@@ -13,6 +13,7 @@ SRCS= ASTDumper.cpp \
ClangExpressionParser.cpp \
ClangExpressionVariable.cpp \
ClangFunction.cpp \
+ ClangModulesDeclVendor.cpp \
ClangPersistentVariables.cpp \
ClangUserExpression.cpp \
ClangUtilityFunction.cpp \
diff --git a/lib/clang/liblldbHostCommon/Makefile b/lib/clang/liblldbHostCommon/Makefile
index f2022bbf1103..af3c053655f0 100644
--- a/lib/clang/liblldbHostCommon/Makefile
+++ b/lib/clang/liblldbHostCommon/Makefile
@@ -6,20 +6,32 @@ LIB= lldbHostCommon
SRCDIR= tools/lldb/source/Host/common
SRCS= Condition.cpp \
- DynamicLibrary.cpp \
Editline.cpp \
File.cpp \
FileSpec.cpp \
Host.cpp \
+ HostInfoBase.cpp \
+ HostNativeThreadBase.cpp \
+ HostProcess.cpp \
+ HostThread.cpp \
+ IOObject.cpp \
+ MonitoringProcessLauncher.cpp \
Mutex.cpp \
OptionParser.cpp \
+ PipeBase.cpp \
ProcessRunLock.cpp \
+ Socket.cpp \
SocketAddress.cpp \
+ SoftwareBreakpoint.cpp \
Symbols.cpp \
Terminal.cpp \
+ ThisThread.cpp \
+ ThreadLauncher.cpp \
TimeValue.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbHostFreeBSD/Makefile b/lib/clang/liblldbHostFreeBSD/Makefile
index e07f8ed791f4..6ebc9b48d2d0 100644
--- a/lib/clang/liblldbHostFreeBSD/Makefile
+++ b/lib/clang/liblldbHostFreeBSD/Makefile
@@ -5,7 +5,10 @@
LIB= lldbHostFreeBSD
SRCDIR= tools/lldb/source/Host/freebsd
-SRCS= Host.cpp
+SRCS= Host.cpp \
+ HostInfoFreeBSD.cpp \
+ HostThreadFreeBSD.cpp \
+ ThisThread.cpp
TGHDRS= DiagnosticCommonKinds \
DeclNodes \
diff --git a/lib/clang/liblldbHostPOSIX/Makefile b/lib/clang/liblldbHostPOSIX/Makefile
new file mode 100644
index 000000000000..6fe660a4e9f0
--- /dev/null
+++ b/lib/clang/liblldbHostPOSIX/Makefile
@@ -0,0 +1,16 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= lldbHostPOSIX
+
+SRCDIR= tools/lldb/source/Host/posix
+SRCS= ConnectionFileDescriptorPosix.cpp \
+ FileSystem.cpp \
+ HostInfoPosix.cpp \
+ HostProcessPosix.cpp \
+ HostThreadPosix.cpp \
+ PipePosix.cpp \
+ ProcessLauncherPosix.cpp
+
+.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbInterpreter/Makefile b/lib/clang/liblldbInterpreter/Makefile
index c560adfe196a..f707d9bb7124 100644
--- a/lib/clang/liblldbInterpreter/Makefile
+++ b/lib/clang/liblldbInterpreter/Makefile
@@ -11,6 +11,7 @@ SRCS= Args.cpp \
CommandObject.cpp \
CommandObjectRegexCommand.cpp \
CommandObjectScript.cpp \
+ CommandOptionValidators.cpp \
CommandReturnObject.cpp \
OptionGroupArchitecture.cpp \
OptionGroupBoolean.cpp \
@@ -27,6 +28,7 @@ SRCS= Args.cpp \
OptionValueArgs.cpp \
OptionValueArray.cpp \
OptionValueBoolean.cpp \
+ OptionValueChar.cpp \
OptionValueDictionary.cpp \
OptionValueEnumeration.cpp \
OptionValueFileSpec.cpp \
@@ -48,7 +50,9 @@ SRCS= Args.cpp \
ScriptInterpreterNone.cpp \
ScriptInterpreterPython.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbPluginABISysV_ppc/Makefile b/lib/clang/liblldbPluginABISysV_ppc/Makefile
new file mode 100644
index 000000000000..4cbbc0213bba
--- /dev/null
+++ b/lib/clang/liblldbPluginABISysV_ppc/Makefile
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= lldbPluginABISysV_ppc
+
+SRCDIR= tools/lldb/source/Plugins/ABI/SysV-ppc
+SRCS= ABISysV_ppc.cpp
+
+TGHDRS= DiagnosticCommonKinds \
+ DeclNodes \
+ StmtNodes \
+ CommentCommandList
+
+.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginABISysV_ppc64/Makefile b/lib/clang/liblldbPluginABISysV_ppc64/Makefile
new file mode 100644
index 000000000000..fe72ab55937e
--- /dev/null
+++ b/lib/clang/liblldbPluginABISysV_ppc64/Makefile
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= lldbPluginABISysV_ppc64
+
+SRCDIR= tools/lldb/source/Plugins/ABI/SysV-ppc64
+SRCS= ABISysV_ppc64.cpp
+
+TGHDRS= DiagnosticCommonKinds \
+ DeclNodes \
+ StmtNodes \
+ CommentCommandList
+
+.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginInstructionARM64/Makefile b/lib/clang/liblldbPluginInstructionARM64/Makefile
new file mode 100644
index 000000000000..92d976e3dca4
--- /dev/null
+++ b/lib/clang/liblldbPluginInstructionARM64/Makefile
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= lldbPluginInstructionARM64
+
+SRCDIR= tools/lldb/source/Plugins/Instruction/ARM64
+SRCS= EmulateInstructionARM64.cpp
+
+.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile b/lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile
new file mode 100644
index 000000000000..bb02244c7d01
--- /dev/null
+++ b/lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile
@@ -0,0 +1,17 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= lldbPluginInstrumentationRuntimeAddressSanitizer
+
+SRCDIR= tools/lldb/source/Plugins/InstrumentationRuntime/AddressSanitizer
+SRCS= AddressSanitizerRuntime.cpp
+
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
+ DeclNodes \
+ StmtNodes \
+ CommentCommandList
+
+.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginJITLoaderGDB/Makefile b/lib/clang/liblldbPluginJITLoaderGDB/Makefile
new file mode 100644
index 000000000000..80e84dfbb270
--- /dev/null
+++ b/lib/clang/liblldbPluginJITLoaderGDB/Makefile
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= lldbPluginJITLoaderGDB
+
+SRCDIR= tools/lldb/source/Plugins/JITLoader/GDB
+SRCS= JITLoaderGDB.cpp
+
+TGHDRS= DiagnosticCommonKinds \
+ DeclNodes \
+ StmtNodes \
+ CommentCommandList
+
+.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginMemoryHistoryASan/Makefile b/lib/clang/liblldbPluginMemoryHistoryASan/Makefile
new file mode 100644
index 000000000000..ac57d6a6a95e
--- /dev/null
+++ b/lib/clang/liblldbPluginMemoryHistoryASan/Makefile
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= lldbPluginMemoryHistoryASan
+
+SRCDIR= tools/lldb/source/Plugins/MemoryHistory/asan
+SRCS= MemoryHistoryASan.cpp
+
+TGHDRS= DiagnosticCommonKinds \
+ DeclNodes \
+ StmtNodes \
+ CommentCommandList
+
+.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginObjectFileJIT/Makefile b/lib/clang/liblldbPluginObjectFileJIT/Makefile
new file mode 100644
index 000000000000..264035017afa
--- /dev/null
+++ b/lib/clang/liblldbPluginObjectFileJIT/Makefile
@@ -0,0 +1,17 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= lldbPluginObjectFileJIT
+
+SRCDIR= tools/lldb/source/Plugins/ObjectFile/JIT
+SRCS= ObjectFileJIT.cpp
+
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
+ DeclNodes \
+ StmtNodes \
+ CommentCommandList
+
+.include "../lldb.lib.mk"
diff --git a/lib/clang/liblldbPluginPlatformFreeBSD/Makefile b/lib/clang/liblldbPluginPlatformFreeBSD/Makefile
index 9be7af37b9b2..c2eee8abf40c 100644
--- a/lib/clang/liblldbPluginPlatformFreeBSD/Makefile
+++ b/lib/clang/liblldbPluginPlatformFreeBSD/Makefile
@@ -7,7 +7,9 @@ LIB= lldbPluginPlatformFreeBSD
SRCDIR= tools/lldb/source/Plugins/Platform/FreeBSD
SRCS= PlatformFreeBSD.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbPluginPlatformGDB/Makefile b/lib/clang/liblldbPluginPlatformGDB/Makefile
index 1d8a99498411..714a311bac54 100644
--- a/lib/clang/liblldbPluginPlatformGDB/Makefile
+++ b/lib/clang/liblldbPluginPlatformGDB/Makefile
@@ -7,7 +7,9 @@ LIB= lldbPluginPlatformGDB
SRCDIR= tools/lldb/source/Plugins/Platform/gdb-server
SRCS= PlatformRemoteGDBServer.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbPluginProcessElfCore/Makefile b/lib/clang/liblldbPluginProcessElfCore/Makefile
index 30198b591fb3..66852dd41a35 100644
--- a/lib/clang/liblldbPluginProcessElfCore/Makefile
+++ b/lib/clang/liblldbPluginProcessElfCore/Makefile
@@ -11,6 +11,7 @@ SRCDIR= tools/lldb/source/Plugins/Process/elf-core
SRCS= ProcessElfCore.cpp \
ThreadElfCore.cpp \
RegisterContextPOSIXCore_mips64.cpp \
+ RegisterContextPOSIXCore_powerpc.cpp \
RegisterContextPOSIXCore_x86_64.cpp
TGHDRS= DiagnosticCommonKinds \
diff --git a/lib/clang/liblldbPluginProcessGDBRemote/Makefile b/lib/clang/liblldbPluginProcessGDBRemote/Makefile
index c76fe8a2a4d2..5bbb40fc96c8 100644
--- a/lib/clang/liblldbPluginProcessGDBRemote/Makefile
+++ b/lib/clang/liblldbPluginProcessGDBRemote/Makefile
@@ -13,7 +13,9 @@ SRCS= GDBRemoteCommunication.cpp \
ProcessGDBRemoteLog.cpp \
ThreadGDBRemote.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbPluginProcessPOSIX/Makefile b/lib/clang/liblldbPluginProcessPOSIX/Makefile
index f681fd343260..ddd902a215d0 100644
--- a/lib/clang/liblldbPluginProcessPOSIX/Makefile
+++ b/lib/clang/liblldbPluginProcessPOSIX/Makefile
@@ -15,17 +15,14 @@ SRCS= POSIXStopInfo.cpp \
ProcessMessage.cpp \
ProcessPOSIX.cpp \
ProcessPOSIXLog.cpp \
- RegisterContextFreeBSD_i386.cpp \
- RegisterContextFreeBSD_mips64.cpp \
- RegisterContextFreeBSD_x86_64.cpp \
- RegisterContextLinux_i386.cpp \
- RegisterContextLinux_x86_64.cpp \
+ RegisterContextPOSIXProcessMonitor_arm64.cpp \
RegisterContextPOSIXProcessMonitor_mips64.cpp \
- RegisterContextPOSIXProcessMonitor_x86.cpp \
- RegisterContextPOSIX_mips64.cpp \
- RegisterContextPOSIX_x86.cpp
+ RegisterContextPOSIXProcessMonitor_powerpc.cpp \
+ RegisterContextPOSIXProcessMonitor_x86.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbPluginProcessUtility/Makefile b/lib/clang/liblldbPluginProcessUtility/Makefile
index 145925468170..d43396f9647f 100644
--- a/lib/clang/liblldbPluginProcessUtility/Makefile
+++ b/lib/clang/liblldbPluginProcessUtility/Makefile
@@ -6,27 +6,43 @@ LIB= lldbPluginProcessUtility
SRCDIR= tools/lldb/source/Plugins/Process/Utility
SRCS= DynamicRegisterInfo.cpp \
+ FreeBSDSignals.cpp \
HistoryThread.cpp \
HistoryUnwind.cpp \
InferiorCallPOSIX.cpp \
+ LinuxSignals.cpp \
RegisterContextDarwin_arm.cpp \
+ RegisterContextDarwin_arm64.cpp \
RegisterContextDarwin_i386.cpp \
RegisterContextDarwin_x86_64.cpp \
RegisterContextDummy.cpp \
+ RegisterContextFreeBSD_i386.cpp \
+ RegisterContextFreeBSD_mips64.cpp \
+ RegisterContextFreeBSD_powerpc.cpp \
+ RegisterContextFreeBSD_x86_64.cpp \
RegisterContextHistory.cpp \
+ RegisterContextLinux_arm64.cpp \
+ RegisterContextLinux_i386.cpp \
+ RegisterContextLinux_x86_64.cpp \
RegisterContextLLDB.cpp \
RegisterContextMach_arm.cpp \
RegisterContextMach_i386.cpp \
RegisterContextMach_x86_64.cpp \
RegisterContextMacOSXFrameBackchain.cpp \
RegisterContextMemory.cpp \
+ RegisterContextPOSIX_arm64.cpp \
+ RegisterContextPOSIX_mips64.cpp \
+ RegisterContextPOSIX_powerpc.cpp \
+ RegisterContextPOSIX_x86.cpp \
RegisterContextThreadMemory.cpp \
StopInfoMachException.cpp \
ThreadMemory.cpp \
UnwindLLDB.cpp \
UnwindMacOSXFrameBackchain.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbPluginSymbolFileDWARF/Makefile b/lib/clang/liblldbPluginSymbolFileDWARF/Makefile
index ac23199b67ce..5b8dbfd57435 100644
--- a/lib/clang/liblldbPluginSymbolFileDWARF/Makefile
+++ b/lib/clang/liblldbPluginSymbolFileDWARF/Makefile
@@ -31,7 +31,9 @@ SRCS= DWARFAbbreviationDeclaration.cpp \
SymbolFileDWARFDebugMap.cpp \
UniqueDWARFASTType.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList \
diff --git a/lib/clang/liblldbSymbol/Makefile b/lib/clang/liblldbSymbol/Makefile
index ed22ec373acc..82c11ff25211 100644
--- a/lib/clang/liblldbSymbol/Makefile
+++ b/lib/clang/liblldbSymbol/Makefile
@@ -12,6 +12,7 @@ SRCS= Block.cpp \
ClangExternalASTSourceCallbacks.cpp \
ClangExternalASTSourceCommon.cpp \
ClangNamespaceDecl.cpp \
+ CompactUnwindInfo.cpp \
CompileUnit.cpp \
Declaration.cpp \
DWARFCallFrameInfo.cpp \
diff --git a/lib/clang/liblldbTarget/Makefile b/lib/clang/liblldbTarget/Makefile
index 2e0226d59754..95ced8d2b5ec 100644
--- a/lib/clang/liblldbTarget/Makefile
+++ b/lib/clang/liblldbTarget/Makefile
@@ -10,13 +10,23 @@ SRCDIR= tools/lldb/source/Target
SRCS= ABI.cpp \
CPPLanguageRuntime.cpp \
ExecutionContext.cpp \
+ FileAction.cpp \
+ InstrumentationRuntime.cpp \
+ InstrumentationRuntimeStopInfo.cpp \
+ JITLoader.cpp \
+ JITLoaderList.cpp \
LanguageRuntime.cpp \
Memory.cpp \
+ MemoryHistory.cpp \
+ NativeRegisterContext.cpp \
+ NativeRegisterContextRegisterInfo.cpp \
ObjCLanguageRuntime.cpp \
OperatingSystem.cpp \
PathMappingList.cpp \
Platform.cpp \
Process.cpp \
+ ProcessInfo.cpp \
+ ProcessLaunchInfo.cpp \
Queue.cpp \
QueueItem.cpp \
QueueList.cpp \
@@ -31,11 +41,13 @@ SRCS= ABI.cpp \
Target.cpp \
TargetList.cpp \
Thread.cpp \
+ ThreadCollection.cpp \
ThreadList.cpp \
ThreadPlan.cpp \
ThreadPlanBase.cpp \
ThreadPlanCallFunction.cpp \
ThreadPlanCallUserExpression.cpp \
+ ThreadPlanPython.cpp \
ThreadPlanRunToAddress.cpp \
ThreadPlanShouldStopHere.cpp \
ThreadPlanStepInRange.cpp \
@@ -51,7 +63,9 @@ SRCS= ABI.cpp \
UnixSignals.cpp \
UnwindAssembly.cpp
-TGHDRS= DiagnosticCommonKinds \
+TGHDRS= AttrList \
+ Attrs \
+ DiagnosticCommonKinds \
DeclNodes \
StmtNodes \
CommentCommandList
diff --git a/lib/clang/liblldbUtility/Makefile b/lib/clang/liblldbUtility/Makefile
index e5723b2fdad9..13ed72df32ca 100644
--- a/lib/clang/liblldbUtility/Makefile
+++ b/lib/clang/liblldbUtility/Makefile
@@ -5,13 +5,17 @@
LIB= lldbUtility
SRCDIR= tools/lldb/source/Utility
-SRCS= ARM_DWARF_Registers.cpp \
+SRCS= ARM64_DWARF_Registers.cpp \
+ ARM_DWARF_Registers.cpp \
KQueue.cpp \
PseudoTerminal.cpp \
Range.cpp \
+ RegisterNumber.cpp \
SharingPtr.cpp \
StringExtractor.cpp \
StringExtractorGDBRemote.cpp \
- TimeSpecTimeout.cpp
+ StringLexer.cpp \
+ TimeSpecTimeout.cpp \
+ UriParser.cpp
.include "../lldb.lib.mk"
diff --git a/lib/clang/libllvmaarch64asmparser/Makefile b/lib/clang/libllvmaarch64asmparser/Makefile
new file mode 100644
index 000000000000..d93fb9ae2ac5
--- /dev/null
+++ b/lib/clang/libllvmaarch64asmparser/Makefile
@@ -0,0 +1,16 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= llvmaarch64asmparser
+
+SRCDIR= lib/Target/AArch64/AsmParser
+INCDIR= lib/Target/AArch64
+SRCS= AArch64AsmParser.cpp
+
+TGHDRS= AArch64GenAsmMatcher \
+ AArch64GenInstrInfo \
+ AArch64GenRegisterInfo \
+ AArch64GenSubtargetInfo
+
+.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmaarch64asmparser/Makefile.depend b/lib/clang/libllvmaarch64asmparser/Makefile.depend
new file mode 100644
index 000000000000..39ddb0eb9b99
--- /dev/null
+++ b/lib/clang/libllvmaarch64asmparser/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AArch64AsmParser.o: AArch64GenAsmMatcher.inc.h
+AArch64AsmParser.o: AArch64GenInstrInfo.inc.h
+AArch64AsmParser.o: AArch64GenRegisterInfo.inc.h
+AArch64AsmParser.o: AArch64GenSubtargetInfo.inc.h
+AArch64AsmParser.po: AArch64GenAsmMatcher.inc.h
+AArch64AsmParser.po: AArch64GenInstrInfo.inc.h
+AArch64AsmParser.po: AArch64GenRegisterInfo.inc.h
+AArch64AsmParser.po: AArch64GenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmaarch64codegen/Makefile b/lib/clang/libllvmaarch64codegen/Makefile
new file mode 100644
index 000000000000..db0023f991c2
--- /dev/null
+++ b/lib/clang/libllvmaarch64codegen/Makefile
@@ -0,0 +1,46 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= llvmaarch64codegen
+
+SRCDIR= lib/Target/AArch64
+SRCS= AArch64A53Fix835769.cpp \
+ AArch64A57FPLoadBalancing.cpp \
+ AArch64AddressTypePromotion.cpp \
+ AArch64AdvSIMDScalarPass.cpp \
+ AArch64AsmPrinter.cpp \
+ AArch64BranchRelaxation.cpp \
+ AArch64CleanupLocalDynamicTLSPass.cpp \
+ AArch64CollectLOH.cpp \
+ AArch64ConditionOptimizer.cpp \
+ AArch64ConditionalCompares.cpp \
+ AArch64DeadRegisterDefinitionsPass.cpp \
+ AArch64ExpandPseudoInsts.cpp \
+ AArch64FastISel.cpp \
+ AArch64FrameLowering.cpp \
+ AArch64ISelDAGToDAG.cpp \
+ AArch64ISelLowering.cpp \
+ AArch64InstrInfo.cpp \
+ AArch64LoadStoreOptimizer.cpp \
+ AArch64MCInstLower.cpp \
+ AArch64PBQPRegAlloc.cpp \
+ AArch64PromoteConstant.cpp \
+ AArch64RegisterInfo.cpp \
+ AArch64SelectionDAGInfo.cpp \
+ AArch64StorePairSuppress.cpp \
+ AArch64Subtarget.cpp \
+ AArch64TargetMachine.cpp \
+ AArch64TargetObjectFile.cpp \
+ AArch64TargetTransformInfo.cpp
+
+TGHDRS= AArch64GenCallingConv \
+ AArch64GenDAGISel \
+ AArch64GenFastISel \
+ AArch64GenInstrInfo \
+ AArch64GenMCPseudoLowering \
+ AArch64GenRegisterInfo \
+ AArch64GenSubtargetInfo \
+ Intrinsics
+
+.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmaarch64desc/Makefile b/lib/clang/libllvmaarch64desc/Makefile
new file mode 100644
index 000000000000..041fbf21db61
--- /dev/null
+++ b/lib/clang/libllvmaarch64desc/Makefile
@@ -0,0 +1,24 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= llvmaarch64desc
+
+SRCDIR= lib/Target/AArch64/MCTargetDesc
+SRCS= AArch64AsmBackend.cpp \
+ AArch64ELFObjectWriter.cpp \
+ AArch64ELFStreamer.cpp \
+ AArch64MCAsmInfo.cpp \
+ AArch64MCCodeEmitter.cpp \
+ AArch64MCExpr.cpp \
+ AArch64MCTargetDesc.cpp \
+ AArch64MachObjectWriter.cpp \
+ AArch64TargetStreamer.cpp
+CFLAGS+= -I${LLVM_SRCS}/${SRCDIR}/..
+
+TGHDRS= AArch64GenInstrInfo \
+ AArch64GenMCCodeEmitter \
+ AArch64GenRegisterInfo \
+ AArch64GenSubtargetInfo
+
+.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmaarch64desc/Makefile.depend b/lib/clang/libllvmaarch64desc/Makefile.depend
new file mode 100644
index 000000000000..f1a450cd7529
--- /dev/null
+++ b/lib/clang/libllvmaarch64desc/Makefile.depend
@@ -0,0 +1,47 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AArch64AsmBackend.o: AArch64GenInstrInfo.inc.h
+AArch64AsmBackend.o: AArch64GenRegisterInfo.inc.h
+AArch64AsmBackend.o: AArch64GenSubtargetInfo.inc.h
+AArch64AsmBackend.po: AArch64GenInstrInfo.inc.h
+AArch64AsmBackend.po: AArch64GenRegisterInfo.inc.h
+AArch64AsmBackend.po: AArch64GenSubtargetInfo.inc.h
+AArch64ELFObjectWriter.o: AArch64GenInstrInfo.inc.h
+AArch64ELFObjectWriter.o: AArch64GenRegisterInfo.inc.h
+AArch64ELFObjectWriter.o: AArch64GenSubtargetInfo.inc.h
+AArch64ELFObjectWriter.po: AArch64GenInstrInfo.inc.h
+AArch64ELFObjectWriter.po: AArch64GenRegisterInfo.inc.h
+AArch64ELFObjectWriter.po: AArch64GenSubtargetInfo.inc.h
+AArch64MCCodeEmitter.o: AArch64GenInstrInfo.inc.h
+AArch64MCCodeEmitter.o: AArch64GenMCCodeEmitter.inc.h
+AArch64MCCodeEmitter.o: AArch64GenRegisterInfo.inc.h
+AArch64MCCodeEmitter.o: AArch64GenSubtargetInfo.inc.h
+AArch64MCCodeEmitter.po: AArch64GenInstrInfo.inc.h
+AArch64MCCodeEmitter.po: AArch64GenMCCodeEmitter.inc.h
+AArch64MCCodeEmitter.po: AArch64GenRegisterInfo.inc.h
+AArch64MCCodeEmitter.po: AArch64GenSubtargetInfo.inc.h
+AArch64MCTargetDesc.o: AArch64GenInstrInfo.inc.h
+AArch64MCTargetDesc.o: AArch64GenRegisterInfo.inc.h
+AArch64MCTargetDesc.o: AArch64GenSubtargetInfo.inc.h
+AArch64MCTargetDesc.po: AArch64GenInstrInfo.inc.h
+AArch64MCTargetDesc.po: AArch64GenRegisterInfo.inc.h
+AArch64MCTargetDesc.po: AArch64GenSubtargetInfo.inc.h
+AArch64MachObjectWriter.o: AArch64GenInstrInfo.inc.h
+AArch64MachObjectWriter.o: AArch64GenRegisterInfo.inc.h
+AArch64MachObjectWriter.o: AArch64GenSubtargetInfo.inc.h
+AArch64MachObjectWriter.po: AArch64GenInstrInfo.inc.h
+AArch64MachObjectWriter.po: AArch64GenRegisterInfo.inc.h
+AArch64MachObjectWriter.po: AArch64GenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmaarch64disassembler/Makefile b/lib/clang/libllvmaarch64disassembler/Makefile
new file mode 100644
index 000000000000..0cf9658b6a27
--- /dev/null
+++ b/lib/clang/libllvmaarch64disassembler/Makefile
@@ -0,0 +1,20 @@
+# $FreeBSD$
+
+.include <src.opts.mk>
+
+LIB= llvmaarch64disassembler
+
+SRCDIR= lib/Target/AArch64/Disassembler
+INCDIR= lib/Target/AArch64
+SRCS= AArch64Disassembler.cpp
+
+.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no"
+SRCS+= AArch64ExternalSymbolizer.cpp
+.endif
+
+TGHDRS= AArch64GenDisassemblerTables \
+ AArch64GenInstrInfo \
+ AArch64GenRegisterInfo \
+ AArch64GenSubtargetInfo
+
+.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmaarch64disassembler/Makefile.depend b/lib/clang/libllvmaarch64disassembler/Makefile.depend
new file mode 100644
index 000000000000..ef36bbacae7a
--- /dev/null
+++ b/lib/clang/libllvmaarch64disassembler/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AArch64Disassembler.o: AArch64GenDisassemblerTables.inc.h
+AArch64Disassembler.o: AArch64GenInstrInfo.inc.h
+AArch64Disassembler.o: AArch64GenRegisterInfo.inc.h
+AArch64Disassembler.o: AArch64GenSubtargetInfo.inc.h
+AArch64Disassembler.po: AArch64GenDisassemblerTables.inc.h
+AArch64Disassembler.po: AArch64GenInstrInfo.inc.h
+AArch64Disassembler.po: AArch64GenRegisterInfo.inc.h
+AArch64Disassembler.po: AArch64GenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmaarch64info/Makefile b/lib/clang/libllvmaarch64info/Makefile
new file mode 100644
index 000000000000..c62a6e15316b
--- /dev/null
+++ b/lib/clang/libllvmaarch64info/Makefile
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= llvmaarch64info
+
+SRCDIR= lib/Target/AArch64/TargetInfo
+INCDIR= lib/Target/AArch64
+SRCS= AArch64TargetInfo.cpp
+
+TGHDRS= AArch64GenInstrInfo \
+ AArch64GenRegisterInfo \
+ AArch64GenSubtargetInfo
+
+.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmjit/Makefile.depend b/lib/clang/libllvmaarch64info/Makefile.depend
index 4d8f064b840b..2be5570d3033 100644
--- a/lib/clang/libllvmjit/Makefile.depend
+++ b/lib/clang/libllvmaarch64info/Makefile.depend
@@ -5,8 +5,7 @@ DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
DIRDEPS = \
include \
include/xlocale \
- lib/libc++ \
- lib/msun \
+ usr.bin/clang/tblgen.host \
.include <dirdeps.mk>
diff --git a/lib/clang/libllvmaarch64instprinter/Makefile b/lib/clang/libllvmaarch64instprinter/Makefile
new file mode 100644
index 000000000000..c037dc8854f6
--- /dev/null
+++ b/lib/clang/libllvmaarch64instprinter/Makefile
@@ -0,0 +1,17 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= llvmaarch64instprinter
+
+SRCDIR= lib/Target/AArch64/InstPrinter
+INCDIR= lib/Target/AArch64
+SRCS= AArch64InstPrinter.cpp
+
+TGHDRS= AArch64GenAsmWriter \
+ AArch64GenAsmWriter1 \
+ AArch64GenInstrInfo \
+ AArch64GenRegisterInfo \
+ AArch64GenSubtargetInfo
+
+.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmaarch64instprinter/Makefile.depend b/lib/clang/libllvmaarch64instprinter/Makefile.depend
new file mode 100644
index 000000000000..c2fc210907ee
--- /dev/null
+++ b/lib/clang/libllvmaarch64instprinter/Makefile.depend
@@ -0,0 +1,25 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AArch64InstPrinter.o: AArch64GenAsmWriter.inc.h
+AArch64InstPrinter.o: AArch64GenAsmWriter1.inc.h
+AArch64InstPrinter.o: AArch64GenInstrInfo.inc.h
+AArch64InstPrinter.o: AArch64GenRegisterInfo.inc.h
+AArch64InstPrinter.o: AArch64GenSubtargetInfo.inc.h
+AArch64InstPrinter.po: AArch64GenAsmWriter.inc.h
+AArch64InstPrinter.po: AArch64GenAsmWriter1.inc.h
+AArch64InstPrinter.po: AArch64GenInstrInfo.inc.h
+AArch64InstPrinter.po: AArch64GenRegisterInfo.inc.h
+AArch64InstPrinter.po: AArch64GenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmaarch64utils/Makefile b/lib/clang/libllvmaarch64utils/Makefile
new file mode 100644
index 000000000000..d9459272e01b
--- /dev/null
+++ b/lib/clang/libllvmaarch64utils/Makefile
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= llvmaarch64utils
+
+SRCDIR= lib/Target/AArch64/Utils
+INCDIR= lib/Target/AArch64
+SRCS= AArch64BaseInfo.cpp
+
+TGHDRS= AArch64GenInstrInfo \
+ AArch64GenRegisterInfo \
+ AArch64GenSubtargetInfo
+
+.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmaarch64utils/Makefile.depend b/lib/clang/libllvmaarch64utils/Makefile.depend
new file mode 100644
index 000000000000..59e0fe901791
--- /dev/null
+++ b/lib/clang/libllvmaarch64utils/Makefile.depend
@@ -0,0 +1,21 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AArch64BaseInfo.o: AArch64GenInstrInfo.inc.h
+AArch64BaseInfo.o: AArch64GenRegisterInfo.inc.h
+AArch64BaseInfo.o: AArch64GenSubtargetInfo.inc.h
+AArch64BaseInfo.po: AArch64GenInstrInfo.inc.h
+AArch64BaseInfo.po: AArch64GenRegisterInfo.inc.h
+AArch64BaseInfo.po: AArch64GenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmanalysis/Makefile b/lib/clang/libllvmanalysis/Makefile
index ea2a7189c40f..7c81c5bbe9bc 100644
--- a/lib/clang/libllvmanalysis/Makefile
+++ b/lib/clang/libllvmanalysis/Makefile
@@ -11,10 +11,15 @@ SRCS= AliasAnalysis.cpp \
AliasDebugger.cpp \
AliasSetTracker.cpp \
Analysis.cpp \
+ AssumptionCache.cpp \
BasicAliasAnalysis.cpp \
+ BlockFrequencyInfo.cpp \
+ BlockFrequencyInfoImpl.cpp \
BranchProbabilityInfo.cpp \
CFG.cpp \
CFGPrinter.cpp \
+ CFLAliasAnalysis.cpp \
+ CGSCCPassManager.cpp \
CaptureTracking.cpp \
CodeMetrics.cpp \
ConstantFolding.cpp \
@@ -23,11 +28,14 @@ SRCS= AliasAnalysis.cpp \
DependenceAnalysis.cpp \
DomPrinter.cpp \
DominanceFrontier.cpp \
+ FunctionTargetTransformInfo.cpp \
IVUsers.cpp \
InstCount.cpp \
InstructionSimplify.cpp \
Interval.cpp \
IntervalPartition.cpp \
+ JumpInstrTableInfo.cpp \
+ LazyCallGraph.cpp \
LazyValueInfo.cpp \
LibCallAliasAnalysis.cpp \
LibCallSemantics.cpp \
@@ -50,16 +58,13 @@ SRCS= AliasAnalysis.cpp \
ScalarEvolutionAliasAnalysis.cpp \
ScalarEvolutionExpander.cpp \
ScalarEvolutionNormalization.cpp \
+ ScopedNoAliasAA.cpp \
SparsePropagation.cpp \
TargetTransformInfo.cpp \
Trace.cpp \
TypeBasedAliasAnalysis.cpp \
ValueTracking.cpp
-.if ${MK_CLANG_EXTRAS} != "no"
-SRCS+= BlockFrequencyInfo.cpp
-.endif
-
TGHDRS= Intrinsics
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmarmcodegen/Makefile b/lib/clang/libllvmarmcodegen/Makefile
index db574187a04f..dc951e375dcb 100644
--- a/lib/clang/libllvmarmcodegen/Makefile
+++ b/lib/clang/libllvmarmcodegen/Makefile
@@ -9,7 +9,6 @@ SRCS= A15SDOptimizer.cpp \
ARMAsmPrinter.cpp \
ARMBaseInstrInfo.cpp \
ARMBaseRegisterInfo.cpp \
- ARMCodeEmitter.cpp \
ARMConstantIslandPass.cpp \
ARMConstantPoolValue.cpp \
ARMExpandPseudoInsts.cpp \
@@ -19,11 +18,11 @@ SRCS= A15SDOptimizer.cpp \
ARMISelDAGToDAG.cpp \
ARMISelLowering.cpp \
ARMInstrInfo.cpp \
- ARMJITInfo.cpp \
ARMLoadStoreOptimizer.cpp \
ARMMCInstLower.cpp \
ARMMachineFunctionInfo.cpp \
ARMRegisterInfo.cpp \
+ ARMOptimizeBarriersPass.cpp \
ARMSelectionDAGInfo.cpp \
ARMSubtarget.cpp \
ARMTargetMachine.cpp \
diff --git a/lib/clang/libllvmarmdesc/Makefile b/lib/clang/libllvmarmdesc/Makefile
index 73999adb1317..42c3f5c7cad7 100644
--- a/lib/clang/libllvmarmdesc/Makefile
+++ b/lib/clang/libllvmarmdesc/Makefile
@@ -7,6 +7,7 @@ LIB= llvmarmdesc
SRCDIR= lib/Target/ARM/MCTargetDesc
SRCS= ARMAsmBackend.cpp \
ARMELFObjectWriter.cpp \
+ ARMELFObjectWriter.cpp \
ARMELFStreamer.cpp \
ARMMCAsmInfo.cpp \
ARMMCCodeEmitter.cpp \
@@ -14,7 +15,10 @@ SRCS= ARMAsmBackend.cpp \
ARMMCTargetDesc.cpp \
ARMMachORelocationInfo.cpp \
ARMMachObjectWriter.cpp \
- ARMUnwindOpAsm.cpp
+ ARMTargetStreamer.cpp \
+ ARMUnwindOpAsm.cpp \
+ ARMWinCOFFObjectWriter.cpp \
+ ARMWinCOFFStreamer.cpp
CFLAGS+= -I${LLVM_SRCS}/${SRCDIR}/..
TGHDRS= ARMGenInstrInfo \
diff --git a/lib/clang/libllvmasmprinter/Makefile b/lib/clang/libllvmasmprinter/Makefile
index afb0ecf72753..4ff6f225ec10 100644
--- a/lib/clang/libllvmasmprinter/Makefile
+++ b/lib/clang/libllvmasmprinter/Makefile
@@ -6,19 +6,26 @@ LIB= llvmasmprinter
SRCDIR= lib/CodeGen/AsmPrinter
SRCS= ARMException.cpp \
+ AddressPool.cpp \
AsmPrinter.cpp \
AsmPrinterDwarf.cpp \
AsmPrinterInlineAsm.cpp \
DIE.cpp \
DIEHash.cpp \
+ DbgValueHistoryCalculator.cpp \
DwarfAccelTable.cpp \
DwarfCFIException.cpp \
DwarfCompileUnit.cpp \
DwarfDebug.cpp \
- DwarfException.cpp \
+ DwarfExpression.cpp \
+ DwarfFile.cpp \
+ DwarfStringPool.cpp \
+ DwarfUnit.cpp \
+ EHStreamer.cpp \
ErlangGCPrinter.cpp \
OcamlGCPrinter.cpp \
- Win64Exception.cpp
+ Win64Exception.cpp \
+ WinCodeViewLineTables.cpp
TGHDRS= Intrinsics
diff --git a/lib/clang/libllvmcodegen/Makefile b/lib/clang/libllvmcodegen/Makefile
index e43f39dc23b9..d5d8e43f2906 100644
--- a/lib/clang/libllvmcodegen/Makefile
+++ b/lib/clang/libllvmcodegen/Makefile
@@ -8,11 +8,13 @@ SRCDIR= lib/CodeGen
SRCS= AggressiveAntiDepBreaker.cpp \
AllocationOrder.cpp \
Analysis.cpp \
+ AtomicExpandPass.cpp \
BasicTargetTransformInfo.cpp \
BranchFolding.cpp \
CalcSpillWeights.cpp \
CallingConvLower.cpp \
CodeGen.cpp \
+ CodeGenPrepare.cpp \
CriticalAntiDepBreaker.cpp \
DFAPacketizer.cpp \
DeadMachineInstructionElim.cpp \
@@ -23,14 +25,16 @@ SRCS= AggressiveAntiDepBreaker.cpp \
ExecutionDepsFix.cpp \
ExpandISelPseudos.cpp \
ExpandPostRAPseudos.cpp \
+ ForwardControlFlowIntegrity.cpp \
GCMetadata.cpp \
GCMetadataPrinter.cpp \
GCStrategy.cpp \
+ GlobalMerge.cpp \
IfConversion.cpp \
InlineSpiller.cpp \
InterferenceCache.cpp \
IntrinsicLowering.cpp \
- JITCodeEmitter.cpp \
+ JumpInstrTables.cpp \
LLVMTargetMachine.cpp \
LatencyPriorityQueue.cpp \
LexicalScopes.cpp \
@@ -38,10 +42,10 @@ SRCS= AggressiveAntiDepBreaker.cpp \
LiveInterval.cpp \
LiveIntervalAnalysis.cpp \
LiveIntervalUnion.cpp \
+ LivePhysRegs.cpp \
LiveRangeCalc.cpp \
LiveRangeEdit.cpp \
LiveRegMatrix.cpp \
- LiveRegUnits.cpp \
LiveStackAnalysis.cpp \
LiveVariables.cpp \
LocalStackSlotAllocation.cpp \
@@ -50,8 +54,9 @@ SRCS= AggressiveAntiDepBreaker.cpp \
MachineBlockPlacement.cpp \
MachineBranchProbabilityInfo.cpp \
MachineCSE.cpp \
- MachineCodeEmitter.cpp \
+ MachineCombiner.cpp \
MachineCopyPropagation.cpp \
+ MachineDominanceFrontier.cpp \
MachineDominators.cpp \
MachineFunction.cpp \
MachineFunctionAnalysis.cpp \
@@ -65,6 +70,7 @@ SRCS= AggressiveAntiDepBreaker.cpp \
MachineModuleInfoImpls.cpp \
MachinePassRegistry.cpp \
MachinePostDominators.cpp \
+ MachineRegionInfo.cpp \
MachineRegisterInfo.cpp \
MachineSSAUpdater.cpp \
MachineScheduler.cpp \
@@ -98,12 +104,13 @@ SRCS= AggressiveAntiDepBreaker.cpp \
SjLjEHPrepare.cpp \
SlotIndexes.cpp \
SpillPlacement.cpp \
- Spiller.cpp \
SplitKit.cpp \
StackColoring.cpp \
+ StackMapLivenessAnalysis.cpp \
StackMaps.cpp \
StackProtector.cpp \
StackSlotColoring.cpp \
+ StatepointExampleGC.cpp \
TailDuplication.cpp \
TargetFrameLoweringImpl.cpp \
TargetInstrInfo.cpp \
diff --git a/lib/clang/libllvmcore/Makefile b/lib/clang/libllvmcore/Makefile
index 137b1c31a5f4..921d0bef2a6a 100644
--- a/lib/clang/libllvmcore/Makefile
+++ b/lib/clang/libllvmcore/Makefile
@@ -9,36 +9,44 @@ SRCS= AsmWriter.cpp \
Attributes.cpp \
AutoUpgrade.cpp \
BasicBlock.cpp \
+ Comdat.cpp \
ConstantFold.cpp \
+ ConstantRange.cpp \
Constants.cpp \
Core.cpp \
DIBuilder.cpp \
DataLayout.cpp \
DebugInfo.cpp \
DebugLoc.cpp \
+ DiagnosticInfo.cpp \
+ DiagnosticPrinter.cpp \
Dominators.cpp \
Function.cpp \
GCOV.cpp \
GVMaterializer.cpp \
Globals.cpp \
IRBuilder.cpp \
+ IRPrintingPasses.cpp \
InlineAsm.cpp \
Instruction.cpp \
Instructions.cpp \
IntrinsicInst.cpp \
LLVMContext.cpp \
LLVMContextImpl.cpp \
- LeakDetector.cpp \
LegacyPassManager.cpp \
+ MDBuilder.cpp \
+ Mangler.cpp \
Metadata.cpp \
+ MetadataTracking.cpp \
Module.cpp \
Pass.cpp \
PassManager.cpp \
PassRegistry.cpp \
- PrintModulePass.cpp \
+ Statepoint.cpp \
Type.cpp \
TypeFinder.cpp \
Use.cpp \
+ UseListOrder.cpp \
User.cpp \
Value.cpp \
ValueSymbolTable.cpp \
diff --git a/lib/clang/libllvmdebuginfo/Makefile b/lib/clang/libllvmdebuginfo/Makefile
index c8039dcad564..3cee40e40104 100644
--- a/lib/clang/libllvmdebuginfo/Makefile
+++ b/lib/clang/libllvmdebuginfo/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= llvmdebuginfo
@@ -21,4 +21,9 @@ SRCS= DIContext.cpp \
DWARFTypeUnit.cpp \
DWARFUnit.cpp
+.if ${MK_CLANG_EXTRAS} != "no"
+SRCS+= DWARFAcceleratorTable.cpp \
+ SyntaxHighlighting.cpp
+.endif
+
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmexecutionengine/Makefile b/lib/clang/libllvmexecutionengine/Makefile
index 382dd88f7969..5a7e6c34bf57 100644
--- a/lib/clang/libllvmexecutionengine/Makefile
+++ b/lib/clang/libllvmexecutionengine/Makefile
@@ -7,7 +7,7 @@ LIB= llvmexecutionengine
SRCDIR= lib/ExecutionEngine
SRCS= ExecutionEngine.cpp \
ExecutionEngineBindings.cpp \
- RTDyldMemoryManager.cpp \
+ GDBRegistrationListener.cpp \
TargetSelect.cpp
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvminstrumentation/Makefile b/lib/clang/libllvminstrumentation/Makefile
index faba349ae494..963b6389c6bd 100644
--- a/lib/clang/libllvminstrumentation/Makefile
+++ b/lib/clang/libllvminstrumentation/Makefile
@@ -8,10 +8,11 @@ SRCDIR= lib/Transforms/Instrumentation
SRCS= AddressSanitizer.cpp \
BoundsChecking.cpp \
DataFlowSanitizer.cpp \
- DebugIR.cpp \
GCOVProfiling.cpp \
MemorySanitizer.cpp \
Instrumentation.cpp \
+ InstrProfiling.cpp \
+ SanitizerCoverage.cpp \
ThreadSanitizer.cpp
TGHDRS= Intrinsics
diff --git a/lib/clang/libllvmipa/Makefile b/lib/clang/libllvmipa/Makefile
index c866ca0ddfe0..3380cf358415 100644
--- a/lib/clang/libllvmipa/Makefile
+++ b/lib/clang/libllvmipa/Makefile
@@ -8,7 +8,6 @@ SRCDIR= lib/Analysis/IPA
SRCS= CallGraph.cpp \
CallGraphSCCPass.cpp \
CallPrinter.cpp \
- FindUsedTypes.cpp \
GlobalsModRef.cpp \
InlineCost.cpp
diff --git a/lib/clang/libllvmjit/Makefile b/lib/clang/libllvmjit/Makefile
deleted file mode 100644
index a04eeb614041..000000000000
--- a/lib/clang/libllvmjit/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-LIB= llvmjit
-
-SRCDIR= lib/ExecutionEngine/JIT
-SRCS= JIT.cpp \
- JITEmitter.cpp \
- JITMemoryManager.cpp
-
-.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmmc/Makefile b/lib/clang/libllvmmc/Makefile
index 84ba618902bb..f4582c21f20e 100644
--- a/lib/clang/libllvmmc/Makefile
+++ b/lib/clang/libllvmmc/Makefile
@@ -5,7 +5,8 @@
LIB= llvmmc
SRCDIR= lib/MC
-SRCS= ELFObjectWriter.cpp \
+SRCS= ConstantPools.cpp \
+ ELFObjectWriter.cpp \
MCAsmBackend.cpp \
MCAsmInfo.cpp \
MCAsmInfoCOFF.cpp \
@@ -13,7 +14,6 @@ SRCS= ELFObjectWriter.cpp \
MCAsmInfoELF.cpp \
MCAsmStreamer.cpp \
MCAssembler.cpp \
- MCAtom.cpp \
MCCodeEmitter.cpp \
MCCodeGenInfo.cpp \
MCContext.cpp \
@@ -22,25 +22,18 @@ SRCS= ELFObjectWriter.cpp \
MCELFObjectTargetWriter.cpp \
MCELFStreamer.cpp \
MCExpr.cpp \
- MCExternalSymbolizer.cpp \
- MCFunction.cpp \
MCInst.cpp \
MCInstPrinter.cpp \
MCInstrAnalysis.cpp \
MCLabel.cpp \
+ MCLinkerOptimizationHint.cpp \
MCMachOStreamer.cpp \
MCMachObjectTargetWriter.cpp \
- MCModule.cpp \
- MCModuleYAML.cpp \
MCNullStreamer.cpp \
- MCObjectDisassembler.cpp \
MCObjectFileInfo.cpp \
MCObjectStreamer.cpp \
- MCObjectSymbolizer.cpp \
MCObjectWriter.cpp \
- MCPureStreamer.cpp \
MCRegisterInfo.cpp \
- MCRelocationInfo.cpp \
MCSection.cpp \
MCSectionCOFF.cpp \
MCSectionELF.cpp \
@@ -49,15 +42,15 @@ SRCS= ELFObjectWriter.cpp \
MCSubtargetInfo.cpp \
MCSymbol.cpp \
MCSymbolizer.cpp \
+ MCTargetOptions.cpp \
MCValue.cpp \
MCWin64EH.cpp \
+ MCWinEH.cpp \
MachObjectWriter.cpp \
+ StringTableBuilder.cpp \
SubtargetFeature.cpp \
WinCOFFObjectWriter.cpp \
- WinCOFFStreamer.cpp
-
-.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no"
-SRCS+= MCDisassembler.cpp
-.endif
+ WinCOFFStreamer.cpp \
+ YAML.cpp
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmmcdisassembler/Makefile b/lib/clang/libllvmmcdisassembler/Makefile
index cfcf9193776a..2f8a940adc2e 100644
--- a/lib/clang/libllvmmcdisassembler/Makefile
+++ b/lib/clang/libllvmmcdisassembler/Makefile
@@ -5,6 +5,9 @@
LIB= llvmmcdisassembler
SRCDIR= lib/MC/MCDisassembler
-SRCS= Disassembler.cpp
+SRCS= Disassembler.cpp \
+ MCDisassembler.cpp \
+ MCExternalSymbolizer.cpp \
+ MCRelocationInfo.cpp
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmmipscodegen/Makefile b/lib/clang/libllvmmipscodegen/Makefile
index 9ba70992b0ca..4495f502c026 100644
--- a/lib/clang/libllvmmipscodegen/Makefile
+++ b/lib/clang/libllvmmipscodegen/Makefile
@@ -7,24 +7,26 @@ LIB= llvmmipscodegen
SRCDIR= lib/Target/Mips
SRCS= Mips16FrameLowering.cpp \
Mips16HardFloat.cpp \
+ Mips16HardFloatInfo.cpp \
Mips16ISelDAGToDAG.cpp \
Mips16ISelLowering.cpp \
Mips16InstrInfo.cpp \
Mips16RegisterInfo.cpp \
MipsAnalyzeImmediate.cpp \
MipsAsmPrinter.cpp \
- MipsCodeEmitter.cpp \
+ MipsCCState.cpp \
MipsConstantIslandPass.cpp \
MipsDelaySlotFiller.cpp \
+ MipsFastISel.cpp \
MipsFrameLowering.cpp \
MipsISelDAGToDAG.cpp \
MipsISelLowering.cpp \
MipsInstrInfo.cpp \
- MipsJITInfo.cpp \
MipsLongBranch.cpp \
MipsMCInstLower.cpp \
MipsMachineFunction.cpp \
MipsModuleISelDAGToDAG.cpp \
+ MipsOptimizePICCall.cpp \
MipsOs16.cpp \
MipsRegisterInfo.cpp \
MipsSEFrameLowering.cpp \
@@ -42,6 +44,7 @@ TGHDRS= Intrinsics \
MipsGenCallingConv \
MipsGenCodeEmitter \
MipsGenDAGISel \
+ MipsGenFastISel \
MipsGenInstrInfo \
MipsGenMCPseudoLowering \
MipsGenRegisterInfo \
diff --git a/lib/clang/libllvmmipsdesc/Makefile b/lib/clang/libllvmmipsdesc/Makefile
index 07cbbfa6b74d..f22ff8074f41 100644
--- a/lib/clang/libllvmmipsdesc/Makefile
+++ b/lib/clang/libllvmmipsdesc/Makefile
@@ -5,12 +5,17 @@
LIB= llvmmipsdesc
SRCDIR= lib/Target/Mips/MCTargetDesc
-SRCS= MipsAsmBackend.cpp \
+SRCS= MipsABIFlagsSection.cpp \
+ MipsABIInfo.cpp \
+ MipsAsmBackend.cpp \
MipsELFObjectWriter.cpp \
+ MipsELFStreamer.cpp \
MipsMCAsmInfo.cpp \
MipsMCCodeEmitter.cpp \
+ MipsMCExpr.cpp \
MipsMCTargetDesc.cpp \
- MipsReginfo.cpp \
+ MipsNaClELFStreamer.cpp \
+ MipsOptionRecord.cpp \
MipsTargetStreamer.cpp
CFLAGS+= -I${LLVM_SRCS}/${SRCDIR}/..
diff --git a/lib/clang/libllvmobjcarcopts/Makefile b/lib/clang/libllvmobjcarcopts/Makefile
index 5c47aa8f98e7..ee3ca83ad11f 100644
--- a/lib/clang/libllvmobjcarcopts/Makefile
+++ b/lib/clang/libllvmobjcarcopts/Makefile
@@ -13,7 +13,8 @@ SRCS= ObjCARC.cpp \
ObjCARCUtil.cpp \
ObjCARCContract.cpp \
DependencyAnalysis.cpp \
- ProvenanceAnalysis.cpp
+ ProvenanceAnalysis.cpp \
+ ProvenanceAnalysisEvaluator.cpp
TGHDRS= Intrinsics
diff --git a/lib/clang/libllvmobject/Makefile b/lib/clang/libllvmobject/Makefile
index 7e480930b312..804fff87a398 100644
--- a/lib/clang/libllvmobject/Makefile
+++ b/lib/clang/libllvmobject/Makefile
@@ -13,10 +13,12 @@ SRCS= Archive.cpp \
ELFObjectFile.cpp \
ELFYAML.cpp \
Error.cpp \
+ IRObjectFile.cpp \
MachOObjectFile.cpp \
MachOUniversal.cpp \
Object.cpp \
ObjectFile.cpp \
- YAML.cpp
+ RecordStreamer.cpp \
+ SymbolicFile.cpp
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmpowerpccodegen/Makefile b/lib/clang/libllvmpowerpccodegen/Makefile
index 9fd268bf23bb..211bc22cafa6 100644
--- a/lib/clang/libllvmpowerpccodegen/Makefile
+++ b/lib/clang/libllvmpowerpccodegen/Makefile
@@ -8,14 +8,12 @@ SRCDIR= lib/Target/PowerPC
SRCS= PPCAsmPrinter.cpp \
PPCBranchSelector.cpp \
PPCCTRLoops.cpp \
- PPCCodeEmitter.cpp \
- PPCFastISel.cpp \
+ PPCFastISel.cpp \
PPCFrameLowering.cpp \
PPCHazardRecognizers.cpp \
PPCISelDAGToDAG.cpp \
PPCISelLowering.cpp \
PPCInstrInfo.cpp \
- PPCJITInfo.cpp \
PPCMCInstLower.cpp \
PPCMachineFunctionInfo.cpp \
PPCRegisterInfo.cpp \
diff --git a/lib/clang/libllvmpowerpcdisassembler/Makefile b/lib/clang/libllvmpowerpcdisassembler/Makefile
new file mode 100644
index 000000000000..58735e4c0a59
--- /dev/null
+++ b/lib/clang/libllvmpowerpcdisassembler/Makefile
@@ -0,0 +1,16 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= llvmpowerpcdisassembler
+
+SRCDIR= lib/Target/PowerPC/Disassembler
+INCDIR= lib/Target/PowerPC
+SRCS= PPCDisassembler.cpp
+
+TGHDRS= PPCGenDisassemblerTables \
+ PPCGenInstrInfo \
+ PPCGenRegisterInfo \
+ PPCGenSubtargetInfo
+
+.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmpowerpcdisassembler/Makefile.depend b/lib/clang/libllvmpowerpcdisassembler/Makefile.depend
new file mode 100644
index 000000000000..bf2f722191c4
--- /dev/null
+++ b/lib/clang/libllvmpowerpcdisassembler/Makefile.depend
@@ -0,0 +1,23 @@
+# Autogenerated - do NOT edit!
+
+DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+PPCDisassembler.o: PPCGenDisassemblerTables.inc.h
+PPCDisassembler.o: PPCGenInstrInfo.inc.h
+PPCDisassembler.o: PPCGenRegisterInfo.inc.h
+PPCDisassembler.o: PPCGenSubtargetInfo.inc.h
+PPCDisassembler.po: PPCGenDisassemblerTables.inc.h
+PPCDisassembler.po: PPCGenInstrInfo.inc.h
+PPCDisassembler.po: PPCGenRegisterInfo.inc.h
+PPCDisassembler.po: PPCGenSubtargetInfo.inc.h
+.endif
diff --git a/lib/clang/libllvmprofiledata/Makefile b/lib/clang/libllvmprofiledata/Makefile
new file mode 100644
index 000000000000..332bf1c73d5c
--- /dev/null
+++ b/lib/clang/libllvmprofiledata/Makefile
@@ -0,0 +1,18 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+LIB= llvmprofiledata
+
+SRCDIR= lib/ProfileData
+SRCS= CoverageMapping.cpp \
+ CoverageMappingReader.cpp \
+ CoverageMappingWriter.cpp \
+ InstrProf.cpp \
+ InstrProfReader.cpp \
+ InstrProfWriter.cpp \
+ SampleProf.cpp \
+ SampleProfReader.cpp \
+ SampleProfWriter.cpp
+
+.include "../clang.lib.mk"
diff --git a/lib/libmandoc/Makefile.depend b/lib/clang/libllvmprofiledata/Makefile.depend
index 639d45d8b9b0..639d45d8b9b0 100644
--- a/lib/libmandoc/Makefile.depend
+++ b/lib/clang/libllvmprofiledata/Makefile.depend
diff --git a/lib/clang/libllvmruntimedyld/Makefile b/lib/clang/libllvmruntimedyld/Makefile
index 02ca4bd0f1ae..75eb84338bab 100644
--- a/lib/clang/libllvmruntimedyld/Makefile
+++ b/lib/clang/libllvmruntimedyld/Makefile
@@ -5,8 +5,9 @@
LIB= llvmruntimedyld
SRCDIR= lib/ExecutionEngine/RuntimeDyld
-SRCS= GDBRegistrar.cpp \
+SRCS= RTDyldMemoryManager.cpp \
RuntimeDyld.cpp \
+ RuntimeDyldChecker.cpp \
RuntimeDyldELF.cpp \
RuntimeDyldMachO.cpp
diff --git a/lib/clang/libllvmscalaropts/Makefile b/lib/clang/libllvmscalaropts/Makefile
index 8da4bf06d0c9..bb8dc96bbccf 100644
--- a/lib/clang/libllvmscalaropts/Makefile
+++ b/lib/clang/libllvmscalaropts/Makefile
@@ -6,7 +6,8 @@ LIB= llvmscalaropts
SRCDIR= lib/Transforms/Scalar
SRCS= ADCE.cpp \
- CodeGenPrepare.cpp \
+ AlignmentFromAssumptions.cpp \
+ ConstantHoisting.cpp \
ConstantProp.cpp \
CorrelatedValuePropagation.cpp \
DCE.cpp \
@@ -14,10 +15,10 @@ SRCS= ADCE.cpp \
EarlyCSE.cpp \
FlattenCFGPass.cpp \
GVN.cpp \
- GlobalMerge.cpp \
IndVarSimplify.cpp \
JumpThreading.cpp \
LICM.cpp \
+ LoadCombine.cpp \
LoopDeletion.cpp \
LoopIdiomRecognize.cpp \
LoopRerollPass.cpp \
@@ -27,6 +28,7 @@ SRCS= ADCE.cpp \
LoopUnswitch.cpp \
LowerAtomic.cpp \
MemCpyOptimizer.cpp \
+ MergedLoadStoreMotion.cpp \
PartiallyInlineLibCalls.cpp \
Reassociate.cpp \
Reg2Mem.cpp \
@@ -34,6 +36,8 @@ SRCS= ADCE.cpp \
SROA.cpp \
SampleProfile.cpp \
ScalarReplAggregates.cpp \
+ Scalarizer.cpp \
+ SeparateConstOffsetFromGEP.cpp \
SimplifyCFGPass.cpp \
Sink.cpp \
StructurizeCFG.cpp \
diff --git a/lib/clang/libllvmselectiondag/Makefile b/lib/clang/libllvmselectiondag/Makefile
index 754310286dc8..b73a1c53f8cd 100644
--- a/lib/clang/libllvmselectiondag/Makefile
+++ b/lib/clang/libllvmselectiondag/Makefile
@@ -26,6 +26,7 @@ SRCS= DAGCombiner.cpp \
SelectionDAGDumper.cpp \
SelectionDAGISel.cpp \
SelectionDAGPrinter.cpp \
+ StatepointLowering.cpp \
TargetLowering.cpp \
TargetSelectionDAGInfo.cpp
diff --git a/lib/clang/libllvmsparccodegen/Makefile b/lib/clang/libllvmsparccodegen/Makefile
index 36cf0a6952ad..29bbae15b82c 100644
--- a/lib/clang/libllvmsparccodegen/Makefile
+++ b/lib/clang/libllvmsparccodegen/Makefile
@@ -7,12 +7,10 @@ LIB= llvmsparccodegen
SRCDIR= lib/Target/Sparc
SRCS= DelaySlotFiller.cpp \
SparcAsmPrinter.cpp \
- SparcCodeEmitter.cpp \
SparcFrameLowering.cpp \
SparcISelDAGToDAG.cpp \
SparcISelLowering.cpp \
SparcInstrInfo.cpp \
- SparcJITInfo.cpp \
SparcMCInstLower.cpp \
SparcMachineFunctionInfo.cpp \
SparcRegisterInfo.cpp \
diff --git a/lib/clang/libllvmsupport/Makefile b/lib/clang/libllvmsupport/Makefile
index b7cfe6aa2d86..f325b15e3ec7 100644
--- a/lib/clang/libllvmsupport/Makefile
+++ b/lib/clang/libllvmsupport/Makefile
@@ -8,12 +8,14 @@ SRCDIR= lib/Support
SRCS= APFloat.cpp \
APInt.cpp \
APSInt.cpp \
+ ARMBuildAttrs.cpp \
+ ARMWinEH.cpp \
Allocator.cpp \
Atomic.cpp \
BlockFrequency.cpp \
BranchProbability.cpp \
CommandLine.cpp \
- ConstantRange.cpp \
+ Compression.cpp \
ConvertUTF.c \
ConvertUTFWrapper.cpp \
CrashRecoveryContext.cpp \
@@ -31,39 +33,44 @@ SRCS= APFloat.cpp \
GraphWriter.cpp \
Hashing.cpp \
Host.cpp \
- IncludeFile.cpp \
IntEqClasses.cpp \
IntervalMap.cpp \
IntrusiveRefCntPtr.cpp \
IsInf.cpp \
IsNAN.cpp \
+ LEB128.cpp \
+ LineIterator.cpp \
Locale.cpp \
LockFileManager.cpp \
MD5.cpp \
ManagedStatic.cpp \
+ MathExtras.cpp \
Memory.cpp \
MemoryBuffer.cpp \
MemoryObject.cpp \
Mutex.cpp \
+ Options.cpp \
Path.cpp \
PluginLoader.cpp \
PrettyStackTrace.cpp \
Process.cpp \
Program.cpp \
RWMutex.cpp \
+ RandomNumberGenerator.cpp \
Regex.cpp \
+ ScaledNumber.cpp \
SearchForAddressOfSpecialSymbol.cpp \
Signals.cpp \
SmallPtrSet.cpp \
SmallVector.cpp \
SourceMgr.cpp \
+ SpecialCaseList.cpp \
Statistic.cpp \
- StreamableMemoryObject.cpp \
+ StreamingMemoryObject.cpp \
StringExtras.cpp \
StringMap.cpp \
StringPool.cpp \
StringRef.cpp \
- StringRefMemoryObject.cpp \
TargetRegistry.cpp \
ThreadLocal.cpp \
Threading.cpp \
@@ -84,16 +91,10 @@ SRCS= APFloat.cpp \
regerror.c \
regexec.c \
regfree.c \
- regstrlcpy.c \
- system_error.cpp
-
-.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no"
-SRCS+= Disassembler.cpp
-.endif
+ regstrlcpy.c
.if ${MK_CLANG_EXTRAS} != "no"
-SRCS+= Compression.cpp \
- DataStream.cpp \
+SRCS+= DataStream.cpp \
FileUtilities.cpp \
SystemUtils.cpp
.endif
diff --git a/lib/clang/libllvmtablegen/Makefile b/lib/clang/libllvmtablegen/Makefile
index 9a764b30766f..fb0c5b8763d2 100644
--- a/lib/clang/libllvmtablegen/Makefile
+++ b/lib/clang/libllvmtablegen/Makefile
@@ -8,6 +8,7 @@ SRCDIR= lib/TableGen
SRCS= Error.cpp \
Main.cpp \
Record.cpp \
+ SetTheory.cpp \
StringMatcher.cpp \
TableGenBackend.cpp \
TGLexer.cpp \
diff --git a/lib/clang/libllvmtarget/Makefile b/lib/clang/libllvmtarget/Makefile
index b85fbec0b2b9..3f9619bd4677 100644
--- a/lib/clang/libllvmtarget/Makefile
+++ b/lib/clang/libllvmtarget/Makefile
@@ -5,10 +5,8 @@
LIB= llvmtarget
SRCDIR= lib/Target
-SRCS= Mangler.cpp \
- Target.cpp \
+SRCS= Target.cpp \
TargetIntrinsicInfo.cpp \
- TargetJITInfo.cpp \
TargetLibraryInfo.cpp \
TargetLoweringObjectFile.cpp \
TargetMachine.cpp \
diff --git a/lib/clang/libllvmtransformutils/Makefile b/lib/clang/libllvmtransformutils/Makefile
index cfad040c638d..a3cf212af667 100644
--- a/lib/clang/libllvmtransformutils/Makefile
+++ b/lib/clang/libllvmtransformutils/Makefile
@@ -5,7 +5,9 @@
LIB= llvmtransformutils
SRCDIR= lib/Transforms/Utils
-SRCS= BasicBlockUtils.cpp \
+SRCS= ASanStackFrameLayout.cpp \
+ AddDiscriminators.cpp \
+ BasicBlockUtils.cpp \
BreakCriticalEdges.cpp \
BuildLibCalls.cpp \
BypassSlowDivision.cpp \
@@ -13,6 +15,7 @@ SRCS= BasicBlockUtils.cpp \
CloneModule.cpp \
CmpInstAnalysis.cpp \
CodeExtractor.cpp \
+ CtorUtils.cpp \
DemoteRegToStack.cpp \
FlattenCFG.cpp \
GlobalStatus.cpp \
@@ -36,7 +39,7 @@ SRCS= BasicBlockUtils.cpp \
SimplifyIndVar.cpp \
SimplifyInstructions.cpp \
SimplifyLibCalls.cpp \
- SpecialCaseList.cpp \
+ SymbolRewriter.cpp \
UnifyFunctionExitNodes.cpp \
ValueMapper.cpp
diff --git a/lib/clang/libllvmx86asmparser/Makefile b/lib/clang/libllvmx86asmparser/Makefile
index 0d32f9c158d2..f972065f1236 100644
--- a/lib/clang/libllvmx86asmparser/Makefile
+++ b/lib/clang/libllvmx86asmparser/Makefile
@@ -6,7 +6,8 @@ LIB= llvmx86asmparser
SRCDIR= lib/Target/X86/AsmParser
INCDIR= lib/Target/X86
-SRCS= X86AsmParser.cpp
+SRCS= X86AsmInstrumentation.cpp \
+ X86AsmParser.cpp
TGHDRS= X86GenAsmMatcher \
X86GenInstrInfo \
diff --git a/lib/clang/libllvmx86codegen/Makefile b/lib/clang/libllvmx86codegen/Makefile
index ed7ab8eccf33..b030b1fc2e98 100644
--- a/lib/clang/libllvmx86codegen/Makefile
+++ b/lib/clang/libllvmx86codegen/Makefile
@@ -6,8 +6,7 @@ LIB= llvmx86codegen
SRCDIR= lib/Target/X86
SRCS= X86AsmPrinter.cpp \
- X86COFFMachineModuleInfo.cpp \
- X86CodeEmitter.cpp \
+ X86CallFrameOptimization.cpp \
X86FastISel.cpp \
X86FixupLEAs.cpp \
X86FloatingPoint.cpp \
@@ -15,7 +14,6 @@ SRCS= X86AsmPrinter.cpp \
X86ISelDAGToDAG.cpp \
X86ISelLowering.cpp \
X86InstrInfo.cpp \
- X86JITInfo.cpp \
X86MCInstLower.cpp \
X86MachineFunctionInfo.cpp \
X86PadShortFunction.cpp \
diff --git a/lib/clang/libllvmx86desc/Makefile b/lib/clang/libllvmx86desc/Makefile
index 6401649df690..1ca2839b9348 100644
--- a/lib/clang/libllvmx86desc/Makefile
+++ b/lib/clang/libllvmx86desc/Makefile
@@ -13,7 +13,8 @@ SRCS= X86AsmBackend.cpp \
X86MCTargetDesc.cpp \
X86MachORelocationInfo.cpp \
X86MachObjectWriter.cpp \
- X86WinCOFFObjectWriter.cpp
+ X86WinCOFFObjectWriter.cpp \
+ X86WinCOFFStreamer.cpp
CFLAGS+= -I${LLVM_SRCS}/${SRCDIR}/..
TGHDRS= X86GenInstrInfo \
diff --git a/lib/clang/libllvmx86disassembler/Makefile b/lib/clang/libllvmx86disassembler/Makefile
index e5489a0e6089..23ec976875d4 100644
--- a/lib/clang/libllvmx86disassembler/Makefile
+++ b/lib/clang/libllvmx86disassembler/Makefile
@@ -9,11 +9,12 @@ INCDIR= lib/Target/X86
SRCS= X86Disassembler.cpp
.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no"
-SRCS+= X86DisassemblerDecoder.c
+SRCS+= X86DisassemblerDecoder.cpp
.endif
TGHDRS= X86GenDisassemblerTables \
X86GenInstrInfo \
- X86GenRegisterInfo
+ X86GenRegisterInfo \
+ X86GenSubtargetInfo
.include "../clang.lib.mk"
diff --git a/lib/csu/Makefile b/lib/csu/Makefile
index 320a5a4d4732..5f1cddcde662 100644
--- a/lib/csu/Makefile
+++ b/lib/csu/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
-ARCH= ${MACHINE_ARCH:S/i386/i386-elf/}
-.if exists(${.CURDIR}/${ARCH})
-SUBDIR+= ${ARCH}
+.if exists(${.CURDIR}/${MACHINE_ARCH})
+SUBDIR+= ${MACHINE_ARCH}
.else
SUBDIR+= ${MACHINE_CPUARCH}
.endif
diff --git a/lib/csu/aarch64/Makefile b/lib/csu/aarch64/Makefile
new file mode 100644
index 000000000000..bf4c7b15c422
--- /dev/null
+++ b/lib/csu/aarch64/Makefile
@@ -0,0 +1,44 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../common
+
+SRCS= crt1.c crti.S crtn.S
+OBJS= ${SRCS:N*.h:R:S/$/.o/g}
+OBJS+= Scrt1.o gcrt1.o
+CFLAGS+= -I${.CURDIR}/../common \
+ -I${.CURDIR}/../../libc/include
+
+all: ${OBJS}
+
+CLEANFILES= ${OBJS}
+CLEANFILES+= crt1.s gcrt1.s Scrt1.s
+
+# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
+# directly compiled to .o files.
+
+crt1.s: crt1.c
+ ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
+ sed ${SED_FIX_NOTE} ${.TARGET}
+
+crt1.o: crt1.s
+ ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
+
+gcrt1.s: crt1.c
+ ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
+ sed ${SED_FIX_NOTE} ${.TARGET}
+
+gcrt1.o: gcrt1.s
+ ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
+
+Scrt1.s: crt1.c
+ ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
+ sed ${SED_FIX_NOTE} ${.TARGET}
+
+Scrt1.o: Scrt1.s
+ ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
+
+realinstall:
+ ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${OBJS} ${DESTDIR}${LIBDIR}
+
+.include <bsd.lib.mk>
diff --git a/lib/libc/powerpc/gen/getcontextx.c b/lib/csu/aarch64/crt1.c
index 54f851384811..6518e8d4a98c 100644
--- a/lib/libc/powerpc/gen/getcontextx.c
+++ b/lib/csu/aarch64/crt1.c
@@ -1,11 +1,16 @@
-/*
- * Copyright (c) 2011 Konstantin Belousov <kib@FreeBSD.org>
+/* LINTLIBRARY */
+/*-
+ * Copyright 1996-1998 John D. Polstra.
+ * Copyright 2014 Andrew Turner.
+ * Copyright 2014-2015 The FreeBSD Foundation.
* All rights reserved.
*
+ * Portions of this software were developed by Andrew Turner
+ * under sponsorship from the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
@@ -27,50 +32,58 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-#include <sys/ucontext.h>
-#include <errno.h>
+#ifndef lint
+#ifndef __GNUC__
+#error "GCC is needed to compile this file"
+#endif
+#endif /* lint */
+
#include <stdlib.h>
-int
-__getcontextx_size(void)
-{
+#include "libc_private.h"
+#include "crtbrand.c"
+#include "ignore_init.c"
- return (sizeof(ucontext_t));
-}
+#ifdef GCRT
+extern void _mcleanup(void);
+extern void monstartup(void *, void *);
+extern int eprol;
+extern int etext;
+#endif
-int
-__fillcontextx2(char *ctx)
-{
+void __start(int, char **, char **, void (*)(void));
+
+/* The entry function. */
+__asm(" .text \n"
+" .align 0 \n"
+" .globl _start \n"
+" _start: \n"
+" mov x3, x2 \n" /* cleanup */
+" ldr x0, [sp] \n" /* Load argc */
+" add x1, sp, #8 \n" /* load argv */
+" add x2, x1, x0, lsl #3 \n" /* env is after argv */
+" add x2, x2, #8 \n" /* argv is null terminated */
+" b __start ");
- return (0);
-}
-int
-__fillcontextx(char *ctx)
+/* The entry function. */
+void
+__start(int argc, char *argv[], char *env[], void (*cleanup)(void))
{
- ucontext_t *ucp;
- ucp = (ucontext_t *)ctx;
- return (getcontext(ucp));
-}
+ handle_argv(argc, argv, env);
-__weak_reference(__getcontextx, getcontextx);
+ if (&_DYNAMIC != NULL)
+ atexit(cleanup);
+ else
+ _init_tls();
-ucontext_t *
-__getcontextx(void)
-{
- char *ctx;
- int error;
+#ifdef GCRT
+ atexit(_mcleanup);
+ monstartup(&eprol, &etext);
+__asm__("eprol:");
+#endif
- ctx = malloc(__getcontextx_size());
- if (ctx == NULL)
- return (NULL);
- if (__fillcontextx(ctx) == -1) {
- error = errno;
- free(ctx);
- errno = error;
- return (NULL);
- }
- return ((ucontext_t *)ctx);
+ handle_static_init(argc, argv, env);
+ exit(main(argc, argv, env));
}
diff --git a/lib/csu/aarch64/crti.S b/lib/csu/aarch64/crti.S
new file mode 100644
index 000000000000..13e3b74642d8
--- /dev/null
+++ b/lib/csu/aarch64/crti.S
@@ -0,0 +1,48 @@
+/*-
+ * Copyright 2001 David E. O'Brien
+ * Copyright 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Andrew Turner
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+ .section .init,"ax",@progbits
+ .align 4
+ .globl _init
+ .type _init,@function
+_init:
+ sub sp, sp, #16
+ str lr, [sp]
+
+ .section .fini,"ax",@progbits
+ .align 4
+ .globl _fini
+ .type _fini,@function
+_fini:
+ sub sp, sp, #16
+ str lr, [sp]
+
diff --git a/lib/csu/aarch64/crtn.S b/lib/csu/aarch64/crtn.S
new file mode 100644
index 000000000000..ebb59b710412
--- /dev/null
+++ b/lib/csu/aarch64/crtn.S
@@ -0,0 +1,44 @@
+/*-
+ * Copyright 2001 David E. O'Brien
+ * Copyright 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Andrew Turner
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+ .section .init,"ax",@progbits
+ ldr lr, [sp]
+ add sp, sp, #16
+ ret
+
+
+ .section .fini,"ax",@progbits
+ ldr lr, [sp]
+ add sp, sp, #16
+ ret
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/csu/i386-elf/Makefile b/lib/csu/i386/Makefile
index 57f4f0557318..d5ca4799ba80 100644
--- a/lib/csu/i386-elf/Makefile
+++ b/lib/csu/i386/Makefile
@@ -35,7 +35,7 @@ crt1_c.o: crt1_c.s
crt1.o: crt1_c.o crt1_s.o
${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o
- objcopy --localize-symbol _start1 crt1.o
+ ${OBJCOPY} --localize-symbol _start1 crt1.o
Scrt1_c.s: crt1_c.c
${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
@@ -46,7 +46,7 @@ Scrt1_c.o: Scrt1_c.s
Scrt1.o: Scrt1_c.o crt1_s.o
${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o
- objcopy --localize-symbol _start1 Scrt1.o
+ ${OBJCOPY} --localize-symbol _start1 Scrt1.o
realinstall:
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
diff --git a/lib/csu/i386-elf/Makefile.depend b/lib/csu/i386/Makefile.depend
index 7d982eb5c63a..7d982eb5c63a 100644
--- a/lib/csu/i386-elf/Makefile.depend
+++ b/lib/csu/i386/Makefile.depend
diff --git a/lib/csu/i386-elf/crt1_c.c b/lib/csu/i386/crt1_c.c
index 65de04ce493b..65de04ce493b 100644
--- a/lib/csu/i386-elf/crt1_c.c
+++ b/lib/csu/i386/crt1_c.c
diff --git a/lib/csu/i386-elf/crt1_s.S b/lib/csu/i386/crt1_s.S
index 17ac0e392345..17ac0e392345 100644
--- a/lib/csu/i386-elf/crt1_s.S
+++ b/lib/csu/i386/crt1_s.S
diff --git a/lib/csu/i386-elf/crti.S b/lib/csu/i386/crti.S
index 77e4e77722d7..77e4e77722d7 100644
--- a/lib/csu/i386-elf/crti.S
+++ b/lib/csu/i386/crti.S
diff --git a/lib/csu/i386-elf/crtn.S b/lib/csu/i386/crtn.S
index 0264e22540f1..0264e22540f1 100644
--- a/lib/csu/i386-elf/crtn.S
+++ b/lib/csu/i386/crtn.S
diff --git a/lib/csu/powerpc64/Makefile b/lib/csu/powerpc64/Makefile
index 123391e12a55..1c93355b7c48 100644
--- a/lib/csu/powerpc64/Makefile
+++ b/lib/csu/powerpc64/Makefile
@@ -9,6 +9,13 @@ CFLAGS+= -I${.CURDIR}/../common \
-I${.CURDIR}/../../libc/include \
-mlongcall
+# XXX: See the log for r232932 as to why the above -mlongcall is needed. Since
+# clang doesn't support -mlongcall, and testing shows a clang linked with a
+# clang-built csu segfaults, this must currently be compiled with gcc. Once
+# clang supports -mlongcall, or we get a fixed ld, this can be revisited.
+CC:= gcc
+COMPILER_TYPE:= gcc
+
all: ${OBJS}
CLEANFILES= ${OBJS}
diff --git a/lib/libarchive/Makefile b/lib/libarchive/Makefile
index b7e9d7fc95fe..9dfad77aaf94 100644
--- a/lib/libarchive/Makefile
+++ b/lib/libarchive/Makefile
@@ -4,19 +4,9 @@
LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive
LIB= archive
-DPADD= ${LIBZ}
-LDADD= -lz
-DPADD+= ${LIBBZ2}
-LDADD+= -lbz2
-CFLAGS+= -DHAVE_BZLIB_H=1
-
-DPADD+= ${LIBLZMA}
-LDADD+= -llzma
-CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
-
-DPADD+= ${LIBBSDXML}
-LDADD+= -lbsdxml
+LIBADD= z bz2 lzma bsdxml
+CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
# FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system.
# It has no real relation to the libarchive version number.
@@ -27,17 +17,15 @@ CFLAGS+= -I${.OBJDIR}
.if ${MK_OPENSSL} != "no"
CFLAGS+= -DWITH_OPENSSL
-DPADD+= ${LIBCRYPTO}
-LDADD+= -lcrypto
+LIBADD+= crypto
.else
-DPADD+= ${LIBMD}
-LDADD+= -lmd
+LIBADD+= md
.endif
.if ${MK_ICONV} != "no"
# TODO: This can be changed back to CFLAGS once iconv works correctly
# with statically linked binaries.
-SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=const
+SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=
.endif
.if ${MACHINE_ARCH:Marm*} != "" || ${MACHINE_ARCH:Mmips*} != "" || \
diff --git a/lib/libarchive/config_freebsd.h b/lib/libarchive/config_freebsd.h
index 0df3f917e92d..fbf429fec33c 100644
--- a/lib/libarchive/config_freebsd.h
+++ b/lib/libarchive/config_freebsd.h
@@ -25,6 +25,8 @@
* $FreeBSD$
*/
+#include <osreldate.h>
+
/* FreeBSD 5.0 and later have ACL and extattr support. */
#if __FreeBSD__ > 4
#define HAVE_ACL_CREATE_ENTRY 1
@@ -220,6 +222,11 @@
#define HAVE_ZLIB_H 1
#define TIME_WITH_SYS_TIME 1
+#if __FreeBSD_version >= 1100056
+#define HAVE_FUTIMENS 1
+#define HAVE_UTIMENSAT 1
+#endif
+
/* FreeBSD 4 and earlier lack intmax_t/uintmax_t */
#if __FreeBSD__ < 5
#define intmax_t int64_t
diff --git a/lib/libarchive/test/Makefile b/lib/libarchive/test/Makefile
index 16a485ae2c44..80d6dd4a03ff 100644
--- a/lib/libarchive/test/Makefile
+++ b/lib/libarchive/test/Makefile
@@ -6,9 +6,8 @@ MAN=
PROG=libarchive_test
INTERNALPROG=yes # Don't install this; it's just for testing
-DPADD=${LIBBZ2} ${LIBZ} ${LIBMD} ${LIBCRYPTO} ${LIBBSDXML}
LDADD= -L ${.OBJDIR}/.. -larchive
-LDADD+= -lz -lbz2 -llzma -lmd -lcrypto -lbsdxml
+LIBADD= z bz2 lzma md crypto bsdxml
CFLAGS+= -g
CFLAGS+= -I${.CURDIR}/.. -I${.OBJDIR}
CFLAGS+= -I${LIBARCHIVEDIR}/libarchive -I${LIBARCHIVEDIR}/test_utils
diff --git a/lib/libblocksruntime/Makefile b/lib/libblocksruntime/Makefile
index 01a78fe7c01e..f95393311142 100644
--- a/lib/libblocksruntime/Makefile
+++ b/lib/libblocksruntime/Makefile
@@ -5,7 +5,7 @@ SHLIB_MAJOR=0
CFLAGS+=-I${.CURDIR}
WARNS?= 2
-.PATH: ${.CURDIR}/../../contrib/compiler-rt/BlocksRuntime
+.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/BlocksRuntime
INCS= Block.h Block_private.h
SRCS= data.c runtime.c
diff --git a/lib/libbluetooth/bluetooth.c b/lib/libbluetooth/bluetooth.c
index 23b7df0da970..bbcf0071cfe0 100644
--- a/lib/libbluetooth/bluetooth.c
+++ b/lib/libbluetooth/bluetooth.c
@@ -30,7 +30,7 @@
* $Id: bluetooth.c,v 1.3 2003/05/20 23:04:30 max Exp $
* $FreeBSD$
*/
-
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/lib/libbluetooth/dev.c b/lib/libbluetooth/dev.c
index 1f9e745dd46a..a6295dd2b1f0 100644
--- a/lib/libbluetooth/dev.c
+++ b/lib/libbluetooth/dev.c
@@ -30,6 +30,7 @@
* $FreeBSD$
*/
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdio.h>
#include <string.h>
diff --git a/lib/libbluetooth/hci.c b/lib/libbluetooth/hci.c
index 1ae6ff963d7b..651c0dda1fe7 100644
--- a/lib/libbluetooth/hci.c
+++ b/lib/libbluetooth/hci.c
@@ -31,6 +31,7 @@
*/
#include <assert.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <inttypes.h>
#include <stdio.h>
diff --git a/lib/libbsnmp/libbsnmp/Makefile b/lib/libbsnmp/libbsnmp/Makefile
index 0b9087d6540c..ef6e35b9726b 100644
--- a/lib/libbsnmp/libbsnmp/Makefile
+++ b/lib/libbsnmp/libbsnmp/Makefile
@@ -9,14 +9,14 @@ CONTRIB= ${.CURDIR}/../../../contrib/bsnmp/lib
LIB= bsnmp
SHLIB_MAJOR= 6
+LD_FATAL_WARNINGS= no
CFLAGS+= -I${CONTRIB} -DHAVE_ERR_H -DHAVE_GETADDRINFO -DHAVE_STRLCPY
CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DQUADFMT='"llu"' -DQUADXFMT='"llx"'
.if ${MK_OPENSSL} != "no"
CFLAGS+= -DHAVE_LIBCRYPTO
-DPADD+= ${LIBCRYPTO}
-LDADD+= -lcrypto
+LIBADD= crypto
.endif
SRCS= asn1.c snmp.c snmpagent.c snmpclient.c snmpcrypto.c support.c
diff --git a/lib/libc++/Makefile b/lib/libc++/Makefile
index e55cf55a5d8f..469ee472f500 100644
--- a/lib/libc++/Makefile
+++ b/lib/libc++/Makefile
@@ -62,8 +62,7 @@ CFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -nostdlib -DLIBCXXRT
CXXFLAGS+= -std=c++11
.endif
-DPADD= ${LIBCXXRT}
-LDADD= -lcxxrt
+LIBADD+= cxxrt
LDFLAGS+= --verbose
INCSGROUPS= STD EXP EXT
@@ -76,6 +75,7 @@ STD_HEADERS= __bit_reference\
__hash_table\
__locale\
__mutex_base\
+ __refstring\
__split_buffer\
__sso_allocator\
__std_stream\
@@ -177,8 +177,12 @@ STD+= ${LIBCXXRTDIR}/${hdr}
.endfor
STDDIR= ${CXXINCLUDEDIR}
-EXP_HEADERS= dynarray\
- optional
+EXP_HEADERS= __config\
+ dynarray\
+ optional\
+ string_view\
+ type_traits\
+ utility
.for hdr in ${EXP_HEADERS}
EXP+= ${HDRDIR}/experimental/${hdr}
@@ -204,4 +208,8 @@ afterinstall:
${.OBJDIR}/libstdc++.a
.endif
+# avoid cyclic dependency
+CFLAGS+= -I${LIBCXXRTDIR}
+GENDIRDEPS_FILTER= N*/libcxxrt
+
.include <bsd.lib.mk>
diff --git a/lib/libc++/Makefile.depend b/lib/libc++/Makefile.depend
index e391c404ef63..83e9e6a005e4 100644
--- a/lib/libc++/Makefile.depend
+++ b/lib/libc++/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- lib/libcxxrt \
lib/msun \
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index 56532207743d..b6d3f9f96a3b 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -44,13 +44,11 @@ CFLAGS+=${CANCELPOINTS_CFLAGS}
#
# Link with static libcompiler_rt.a.
#
-DPADD+= ${LIBCOMPILER_RT}
LDFLAGS+= -nodefaultlibs
-LDADD+= -lcompiler_rt
+LIBADD+= compiler_rt
.if ${MK_SSP} != "no"
-DPADD+= ${LIBSSP_NONSHARED}
-LDADD+= -lssp_nonshared
+LIBADD+= ssp_nonshared
.endif
# Extras that live in either libc.a or libc_nonshared.a
@@ -81,7 +79,8 @@ NOASM=
.include "${LIBC_SRCTOP}/net/Makefile.inc"
.include "${LIBC_SRCTOP}/nls/Makefile.inc"
.include "${LIBC_SRCTOP}/posix1e/Makefile.inc"
-.if ${LIBC_ARCH} != "amd64" && \
+.if ${LIBC_ARCH} != "aarch64" && \
+ ${LIBC_ARCH} != "amd64" && \
${LIBC_ARCH} != "powerpc64" && \
${LIBC_ARCH} != "sparc64" && \
${MACHINE_ARCH:Mmipsn32*} == "" && \
@@ -151,14 +150,16 @@ KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c mcount.c strcat.c strchr.c \
libkern: libkern.gen libkern.${LIBC_ARCH}
libkern.gen: ${KQSRCS} ${KSRCS}
- cp -fp ${LIBC_SRCTOP}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
+ ${CP} ${LIBC_SRCTOP}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
libkern.${LIBC_ARCH}:: ${KMSRCS}
.if defined(KMSRCS) && !empty(KMSRCS)
- cp -fp ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH}
+ ${CP} ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH}
.endif
-.include <bsd.arch.inc.mk>
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
.include <bsd.lib.mk>
diff --git a/lib/libc/Makefile.amd64 b/lib/libc/Makefile.amd64
deleted file mode 100644
index dd0f5b0cfb2d..000000000000
--- a/lib/libc/Makefile.amd64
+++ /dev/null
@@ -1,6 +0,0 @@
-# $FreeBSD$
-
-.if ${MK_TESTS} != "no"
-SUBDIR+= tests
-.endif
-
diff --git a/lib/libc/Makefile.i386 b/lib/libc/Makefile.i386
deleted file mode 100644
index dd0f5b0cfb2d..000000000000
--- a/lib/libc/Makefile.i386
+++ /dev/null
@@ -1,6 +0,0 @@
-# $FreeBSD$
-
-.if ${MK_TESTS} != "no"
-SUBDIR+= tests
-.endif
-
diff --git a/lib/libc/aarch64/Makefile.inc b/lib/libc/aarch64/Makefile.inc
new file mode 100644
index 000000000000..5f172008e4c0
--- /dev/null
+++ b/lib/libc/aarch64/Makefile.inc
@@ -0,0 +1,9 @@
+# $FreeBSD$
+#
+# Machine dependent definitions for the arm 64-bit architecture.
+#
+
+# Long double is quad precision
+GDTOASRCS+=strtorQ.c
+MDSRCS+=machdep_ldisQ.c
+SYM_MAPS+=${LIBC_SRCTOP}/aarch64/Symbol.map
diff --git a/lib/libc/aarch64/SYS.h b/lib/libc/aarch64/SYS.h
new file mode 100644
index 000000000000..e0be59d3cddb
--- /dev/null
+++ b/lib/libc/aarch64/SYS.h
@@ -0,0 +1,63 @@
+/*-
+ * Copyright (c) 2014 Andrew Turner
+ * Copyright (c) 2015 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include <sys/syscall.h>
+#include <machine/asm.h>
+
+#define _SYSCALL(name) \
+ mov x8, SYS_ ## name; \
+ svc 0
+
+#define SYSCALL(name) \
+ENTRY(__sys_##name); \
+ WEAK_REFERENCE(__sys_##name, name); \
+ WEAK_REFERENCE(__sys_##name, _##name); \
+ _SYSCALL(name); \
+ ret; \
+END(__sys_##name)
+
+#define PSEUDO(name) \
+ENTRY(__sys_##name); \
+ WEAK_REFERENCE(__sys_##name, _##name); \
+ _SYSCALL(name); \
+ b.cs cerror; \
+ ret; \
+END(__sys_##name)
+
+#define RSYSCALL(name) \
+ENTRY(__sys_##name); \
+ WEAK_REFERENCE(__sys_##name, name); \
+ WEAK_REFERENCE(__sys_##name, _##name); \
+ _SYSCALL(name); \
+ b.cs cerror; \
+ ret; \
+END(__sys_##name)
diff --git a/lib/libc/aarch64/Symbol.map b/lib/libc/aarch64/Symbol.map
new file mode 100644
index 000000000000..a0b33da518db
--- /dev/null
+++ b/lib/libc/aarch64/Symbol.map
@@ -0,0 +1,30 @@
+/*
+ * $FreeBSD$
+ */
+
+/*
+ * This only needs to contain symbols that are not listed in
+ * symbol maps from other parts of libc (i.e., not found in
+ * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...).
+ */
+FBSD_1.0 {
+ /* PSEUDO syscalls */
+ _exit;
+
+ _setjmp;
+ _longjmp;
+ fabs;
+ setjmp;
+ longjmp;
+ sigsetjmp;
+ siglongjmp;
+ vfork;
+ brk;
+ sbrk;
+};
+
+FBSDprivate_1.0 {
+ _set_tp;
+ curbrk;
+ minbrk;
+};
diff --git a/lib/libc/aarch64/_fpmath.h b/lib/libc/aarch64/_fpmath.h
new file mode 100644
index 000000000000..71d0a715233f
--- /dev/null
+++ b/lib/libc/aarch64/_fpmath.h
@@ -0,0 +1,58 @@
+/*-
+ * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
+ * Copyright (2) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+union IEEEl2bits {
+ long double e;
+ struct {
+ unsigned long manl :64;
+ unsigned long manh :48;
+ unsigned int exp :15;
+ unsigned int sign :1;
+ } bits;
+ /* TODO andrew: Check the packing here */
+ struct {
+ unsigned long manl :64;
+ unsigned long manh :48;
+ unsigned int expsign :16;
+ } xbits;
+};
+
+#define LDBL_NBIT 0
+#define LDBL_IMPLICIT_NBIT
+#define mask_nbit_l(u) ((void)0)
+
+#define LDBL_MANH_SIZE 48
+#define LDBL_MANL_SIZE 64
+
+#define LDBL_TO_ARRAY32(u, a) do { \
+ (a)[0] = (uint32_t)(u).bits.manl; \
+ (a)[1] = (uint32_t)((u).bits.manl >> 32); \
+ (a)[2] = (uint32_t)(u).bits.manh; \
+ (a)[3] = (uint32_t)((u).bits.manh >> 32); \
+} while(0)
diff --git a/lib/libc/aarch64/arith.h b/lib/libc/aarch64/arith.h
new file mode 100644
index 000000000000..ecb1a33fccb0
--- /dev/null
+++ b/lib/libc/aarch64/arith.h
@@ -0,0 +1,19 @@
+/*
+ * MD header for contrib/gdtoa
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * NOTE: The definitions in this file must be correct or strtod(3) and
+ * floating point formats in printf(3) will break! The file can be
+ * generated by running contrib/gdtoa/arithchk.c on the target
+ * architecture. See contrib/gdtoa/gdtoaimp.h for details.
+ */
+
+#define IEEE_8087
+#define Arith_Kind_ASL 1
+#define Long int
+#define Intcast (int)(long)
+#define Double_Align
+#define X64_bit_pointers
diff --git a/lib/libc/aarch64/gd_qnan.h b/lib/libc/aarch64/gd_qnan.h
new file mode 100644
index 000000000000..27e8d5811b7e
--- /dev/null
+++ b/lib/libc/aarch64/gd_qnan.h
@@ -0,0 +1,21 @@
+/*
+ * MD header for contrib/gdtoa
+ *
+ * This file can be generated by compiling and running contrib/gdtoa/qnan.c
+ * on the target architecture after arith.h has been generated.
+ *
+ * $FreeBSD$
+ */
+
+#define f_QNAN 0x7fc00000
+#define d_QNAN0 0x0
+#define d_QNAN1 0x7ff80000
+#define ld_QNAN0 0x0
+#define ld_QNAN1 0x0
+#define ld_QNAN2 0x0
+#define ld_QNAN3 0x7fff8000
+#define ldus_QNAN0 0x0
+#define ldus_QNAN1 0x0
+#define ldus_QNAN2 0x0
+#define ldus_QNAN3 0x0
+#define ldus_QNAN4 0x0
diff --git a/lib/libc/aarch64/gen/Makefile.inc b/lib/libc/aarch64/gen/Makefile.inc
new file mode 100644
index 000000000000..c4f7c80a84f7
--- /dev/null
+++ b/lib/libc/aarch64/gen/Makefile.inc
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+SRCS+= fabs.S \
+ flt_rounds.c \
+ ldexp.c \
+ _setjmp.S \
+ _set_tp.c \
+ setjmp.S \
+ sigsetjmp.S \
+ trivial-getcontextx.c
diff --git a/lib/libc/posix1e/acl_size.c b/lib/libc/aarch64/gen/_set_tp.c
index 27ad6515c0fb..a587b2ed7e6b 100644
--- a/lib/libc/posix1e/acl_size.c
+++ b/lib/libc/aarch64/gen/_set_tp.c
@@ -1,5 +1,5 @@
-/*
- * Copyright (c) 2001-2002 Chris D. Faulhaber
+/*-
+ * Copyright (c) 2014 Andrew Turner
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -27,17 +27,16 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <string.h>
#include <sys/types.h>
-#include "namespace.h"
-#include <sys/acl.h>
-#include "un-namespace.h"
-#include <errno.h>
+#include <machine/sysarch.h>
-ssize_t
-acl_size(acl_t acl)
+#include <stdlib.h>
+
+void
+_set_tp(void *tp)
{
- errno = ENOSYS;
- return (-1);
+ asm volatile("msr tpidr_el0, %0" : : "r"(tp));
}
diff --git a/lib/libc/aarch64/gen/_setjmp.S b/lib/libc/aarch64/gen/_setjmp.S
new file mode 100644
index 000000000000..504423bbb9fb
--- /dev/null
+++ b/lib/libc/aarch64/gen/_setjmp.S
@@ -0,0 +1,105 @@
+/*-
+ * Copyright (c) 2014 Andrew Turner
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Andrew Turner
+ * under sponsorship from the FreeBSD Foundation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+#include <machine/setjmp.h>
+
+ENTRY(_setjmp)
+ /* Store the magic value and stack pointer */
+ ldr x8, .Lmagic
+ mov x9, sp
+ stp x8, x9, [x0], #16
+
+ /* Store the general purpose registers and lr */
+ stp x19, x20, [x0], #16
+ stp x21, x22, [x0], #16
+ stp x23, x24, [x0], #16
+ stp x25, x26, [x0], #16
+ stp x27, x28, [x0], #16
+ stp x29, lr, [x0], #16
+
+#ifndef _STANDALONE
+ /* Store the vfp registers */
+ stp d8, d9, [x0], #16
+ stp d10, d11, [x0], #16
+ stp d12, d13, [x0], #16
+ stp d14, d15, [x0]
+#endif
+
+ /* Return value */
+ mov x0, #0
+ ret
+.Lmagic:
+ .align 3
+ .quad _JB_MAGIC__SETJMP
+END(_setjmp)
+
+ENTRY(_longjmp)
+ /* Check the magic value */
+ ldr x8, [x0], #8
+ ldr x9, .Lmagic
+ cmp x8, x9
+ b.ne botch
+
+ /* Restore the stack pointer */
+ ldr x8, [x0], #8
+ mov sp, x8
+
+ /* Restore the general purpose registers and lr */
+ ldp x19, x20, [x0], #16
+ ldp x21, x22, [x0], #16
+ ldp x23, x24, [x0], #16
+ ldp x25, x26, [x0], #16
+ ldp x27, x28, [x0], #16
+ ldp x29, lr, [x0], #16
+
+#ifndef _STANDALONE
+ /* Restore the vfp registers */
+ ldp d8, d9, [x0], #16
+ ldp d10, d11, [x0], #16
+ ldp d12, d13, [x0], #16
+ ldp d14, d15, [x0]
+#endif
+
+ /* Load the return value */
+ mov x0, x1
+ ret
+
+botch:
+#ifdef _STANDALONE
+ b botch
+#else
+ bl _C_LABEL(longjmperror)
+ bl _C_LABEL(abort)
+#endif
+END(_longjmp)
diff --git a/lib/libc/aarch64/gen/fabs.S b/lib/libc/aarch64/gen/fabs.S
new file mode 100644
index 000000000000..2f5fd06dec6c
--- /dev/null
+++ b/lib/libc/aarch64/gen/fabs.S
@@ -0,0 +1,33 @@
+/*-
+ * Copyright (c) 2015 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+ENTRY(fabs)
+ fabs d0, d0
+ ret
+END(fabs)
diff --git a/lib/libc/mips/sys/__vdso_gettc.c b/lib/libc/aarch64/gen/flt_rounds.c
index b99bbc4f3d0f..6f8eeebbad80 100644
--- a/lib/libc/mips/sys/__vdso_gettc.c
+++ b/lib/libc/aarch64/gen/flt_rounds.c
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
+ * Copyright (c) 2012 Ian Lepore <freebsd@damnhippie.dyndns.org>
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,22 +28,22 @@
__FBSDID("$FreeBSD$");
#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/vdso.h>
-#include <errno.h>
-#pragma weak __vdso_gettc
-u_int
-__vdso_gettc(const struct vdso_timehands *th)
-{
+#include <fenv.h>
+#include <float.h>
- return (0);
-}
+static int map[] = {
+ 1, /* round to nearest */
+ 2, /* round to positive infinity */
+ 3, /* round to negative infinity */
+ 0 /* round to zero */
+};
-#pragma weak __vdso_gettimekeep
int
-__vdso_gettimekeep(struct vdso_timekeep **tk)
+__flt_rounds(void)
{
+ uint64_t fpcr;
- return (ENOSYS);
+ asm volatile("mrs %0, fpcr" : "=r" (fpcr));
+ return map[(fpcr >> 22) & 3];
}
diff --git a/lib/libc/aarch64/gen/setjmp.S b/lib/libc/aarch64/gen/setjmp.S
new file mode 100644
index 000000000000..80a94842b37f
--- /dev/null
+++ b/lib/libc/aarch64/gen/setjmp.S
@@ -0,0 +1,123 @@
+/*-
+ * Copyright (c) 2014 Andrew Turner
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Andrew Turner
+ * under sponsorship from the FreeBSD Foundation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+#include <machine/setjmp.h>
+
+ENTRY(setjmp)
+ sub sp, sp, #16
+ stp x0, lr, [sp]
+
+ /* Store the signal mask */
+ add x2, x0, #(_JB_SIGMASK * 8) /* oset */
+ mov x1, #0 /* set */
+ mov x0, #1 /* SIG_BLOCK */
+ bl sigprocmask
+
+ ldp x0, lr, [sp]
+ add sp, sp, #16
+
+ /* Store the magic value and stack pointer */
+ ldr x8, .Lmagic
+ mov x9, sp
+ stp x8, x9, [x0], #16
+
+ /* Store the general purpose registers and lr */
+ stp x19, x20, [x0], #16
+ stp x21, x22, [x0], #16
+ stp x23, x24, [x0], #16
+ stp x25, x26, [x0], #16
+ stp x27, x28, [x0], #16
+ stp x29, lr, [x0], #16
+
+ /* Store the vfp registers */
+ stp d8, d9, [x0], #16
+ stp d10, d11, [x0], #16
+ stp d12, d13, [x0], #16
+ stp d14, d15, [x0]
+
+ /* Return value */
+ mov x0, #0
+ ret
+.Lmagic:
+ .align 3
+ .quad _JB_MAGIC_SETJMP
+END(setjmp)
+
+ENTRY(longjmp)
+ sub sp, sp, #32
+ stp x0, lr, [sp]
+ str x1, [sp, #16]
+
+ /* Restore the signal mask */
+ mov x1, #0 /* oset */
+ add x1, x0, #(_JB_SIGMASK * 8) /* set */
+ mov x0, #3 /* SIG_BLOCK */
+ bl sigprocmask
+
+ ldr x1, [sp, #16]
+ ldp x0, lr, [sp]
+ add sp, sp, #32
+
+ /* Check the magic value */
+ ldr x8, [x0], #8
+ ldr x9, .Lmagic
+ cmp x8, x9
+ b.ne botch
+
+ /* Restore the stack pointer */
+ ldr x8, [x0], #8
+ mov sp, x8
+
+ /* Restore the general purpose registers and lr */
+ ldp x19, x20, [x0], #16
+ ldp x21, x22, [x0], #16
+ ldp x23, x24, [x0], #16
+ ldp x25, x26, [x0], #16
+ ldp x27, x28, [x0], #16
+ ldp x29, lr, [x0], #16
+
+ /* Restore the vfp registers */
+ ldp d8, d9, [x0], #16
+ ldp d10, d11, [x0], #16
+ ldp d12, d13, [x0], #16
+ ldp d14, d15, [x0]
+
+ /* Load the return value */
+ mov x0, x1
+ ret
+
+botch:
+ bl _C_LABEL(longjmperror)
+ bl _C_LABEL(abort)
+END(longjmp)
diff --git a/lib/libc/aarch64/gen/sigsetjmp.S b/lib/libc/aarch64/gen/sigsetjmp.S
new file mode 100644
index 000000000000..8a13c9f005ee
--- /dev/null
+++ b/lib/libc/aarch64/gen/sigsetjmp.S
@@ -0,0 +1,53 @@
+/*-
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+#include <machine/setjmp.h>
+
+ENTRY(sigsetjmp)
+ cmp x1, #0
+ b.eq _C_LABEL(_setjmp)
+ b _C_LABEL(setjmp)
+END(sigsetjmp)
+
+ENTRY(siglongjmp)
+ /* Load the _setjmp magic */
+ ldr x2, .Lmagic
+ ldr x3, [x0]
+
+ /* Check the magic */
+ cmp x2, x3
+ b.eq _C_LABEL(_longjmp)
+ b _C_LABEL(longjmp)
+.Lmagic:
+ .align 3
+ .quad _JB_MAGIC__SETJMP
+END(siglongjmp)
diff --git a/lib/libc/aarch64/sys/Makefile.inc b/lib/libc/aarch64/sys/Makefile.inc
new file mode 100644
index 000000000000..cb56f738b8cb
--- /dev/null
+++ b/lib/libc/aarch64/sys/Makefile.inc
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+SRCS+= trivial-vdso_tc.c
+
+#MDASM= ptrace.S
+MDASM= brk.S \
+ cerror.S \
+ pipe.S \
+ sbrk.S \
+ shmat.S \
+ sigreturn.S \
+ syscall.S \
+ vfork.S
+
+# Don't generate default code for these syscalls:
+NOASM= break.o \
+ exit.o \
+ getlogin.o \
+ openbsd_poll.o \
+ sstk.o \
+ vfork.o \
+ yield.o
+
+PSEUDO= _exit.o \
+ _getlogin.o
diff --git a/lib/libc/aarch64/sys/brk.S b/lib/libc/aarch64/sys/brk.S
new file mode 100644
index 000000000000..09167b60b00b
--- /dev/null
+++ b/lib/libc/aarch64/sys/brk.S
@@ -0,0 +1,93 @@
+/*-
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+#include "SYS.h"
+
+ .data
+ .align 3
+ .globl _C_LABEL(minbrk)
+ .type _C_LABEL(minbrk),#object
+_C_LABEL(minbrk):
+ .quad _C_LABEL(_end)
+
+ .text
+/*
+ * int brk(const void *addr);
+ */
+ENTRY(_brk)
+ WEAK_REFERENCE(_brk, brk)
+
+ /* Load the address of minbrk */
+#ifdef __PIC__
+ adrp x2, :got:minbrk
+ ldr x3, [x2, #:got_lo12:minbrk]
+#else
+ ldr x3, .Lminbrk
+#endif
+
+ /* Get the minimum allowable brk address */
+ ldr x2, [x3]
+
+ /* Validate the address */
+ cmp x0, x2
+ b.ge 1f
+ /* Invalid, set it to the minimum */
+ mov x0, x2
+
+ /* Backup the new address */
+1: mov x4, x0
+
+ /* Update for this value, will overwrite x0 and x1 */
+ _SYSCALL(break)
+ b.cs cerror
+
+#ifdef __PIC__
+ adrp x2, :got:curbrk
+ ldr x3, [x2, #:got_lo12:curbrk]
+#else
+ ldr x3, .Lcurbrk
+#endif
+
+ /* Store the new curbrk value */
+ str x4, [x3]
+
+ /* Return success */
+ mov x0, #0
+ ret
+
+#ifndef __PIC__
+.Lcurbrk:
+ .quad _C_LABEL(curbrk)
+.Lminbrk:
+ .quad _C_LABEL(minbrk)
+#endif
+END(_brk)
diff --git a/lib/libc/aarch64/sys/cerror.S b/lib/libc/aarch64/sys/cerror.S
new file mode 100644
index 000000000000..26c61bc7cc3e
--- /dev/null
+++ b/lib/libc/aarch64/sys/cerror.S
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2014 Andrew Turner
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+ENTRY(cerror)
+ sub sp, sp, #16
+ stp x0, lr, [sp]
+ bl _C_LABEL(__error)
+ ldp x1, lr, [sp]
+ str x1, [x0]
+ movn x0, #0
+ movn x1, #0
+ add sp, sp, #16
+ ret
+END(cerror)
diff --git a/lib/libc/aarch64/sys/pipe.S b/lib/libc/aarch64/sys/pipe.S
new file mode 100644
index 000000000000..6b1cf249c372
--- /dev/null
+++ b/lib/libc/aarch64/sys/pipe.S
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+#include "SYS.h"
+
+ENTRY(__sys_pipe)
+ WEAK_REFERENCE(__sys_pipe, pipe)
+
+ /* Backup the pointer passed to us */
+ mov x2, x0
+
+ /* Make the syscall */
+ _SYSCALL(pipe)
+ b.cs cerror
+
+ /* Store the result */
+ str w0, [x2, #0]
+ str w1, [x2, #4]
+
+ /* Return */
+ mov x0, #0
+ ret
+END(__sys_pipe)
diff --git a/lib/libc/aarch64/sys/sbrk.S b/lib/libc/aarch64/sys/sbrk.S
new file mode 100644
index 000000000000..db9d7e1f7bc8
--- /dev/null
+++ b/lib/libc/aarch64/sys/sbrk.S
@@ -0,0 +1,79 @@
+/*-
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+#include "SYS.h"
+
+ .data
+ .align 3
+ .global _C_LABEL(curbrk)
+ .type _C_LABEL(curbrk),#object
+_C_LABEL(curbrk):
+ .quad _C_LABEL(_end)
+
+ .text
+/*
+ * void *sbrk(intptr_t incr);
+ */
+ENTRY(_sbrk)
+ WEAK_REFERENCE(_sbrk, sbrk)
+
+ /* Load the address of curbrk */
+#ifdef __PIC__
+ adrp x2, :got:curbrk
+ ldr x3, [x2, #:got_lo12:curbrk]
+#else
+ ldr x3, .Lcurbrk
+#endif
+
+ /* Get the current brk address */
+ ldr x2, [x3]
+
+ /* Calculate the new value */
+ add x0, x2, x0
+ mov x4, x0
+
+ /* Update for this value, will overwrite x0 and x1 */
+ _SYSCALL(break)
+ b.cs cerror
+
+ /* Load the old value to return */
+ ldr x0, [x3]
+
+ /* Store the new curbrk value */
+ str x4, [x3]
+
+ ret
+#ifndef __PIC__
+.Lcurbrk:
+ .quad _C_LABEL(curbrk)
+#endif
+END(_sbrk)
diff --git a/lib/libc/powerpc/sys/__vdso_gettc.c b/lib/libc/aarch64/sys/shmat.S
index b99bbc4f3d0f..c0fb34f74c8f 100644
--- a/lib/libc/powerpc/sys/__vdso_gettc.c
+++ b/lib/libc/aarch64/sys/shmat.S
@@ -1,5 +1,9 @@
/*-
- * Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,26 +27,9 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
+#include <machine/asm.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/vdso.h>
-#include <errno.h>
-
-#pragma weak __vdso_gettc
-u_int
-__vdso_gettc(const struct vdso_timehands *th)
-{
-
- return (0);
-}
-
-#pragma weak __vdso_gettimekeep
-int
-__vdso_gettimekeep(struct vdso_timekeep **tk)
-{
+#include "SYS.h"
- return (ENOSYS);
-}
+RSYSCALL(shmat)
diff --git a/lib/libc/aarch64/sys/sigreturn.S b/lib/libc/aarch64/sys/sigreturn.S
new file mode 100644
index 000000000000..21ec1e456f5a
--- /dev/null
+++ b/lib/libc/aarch64/sys/sigreturn.S
@@ -0,0 +1,35 @@
+/*-
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+#include "SYS.h"
+
+RSYSCALL(sigreturn)
diff --git a/lib/libc/aarch64/sys/syscall.S b/lib/libc/aarch64/sys/syscall.S
new file mode 100644
index 000000000000..63148357d567
--- /dev/null
+++ b/lib/libc/aarch64/sys/syscall.S
@@ -0,0 +1,35 @@
+/*-
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+#include "SYS.h"
+
+RSYSCALL(syscall)
diff --git a/lib/libc/aarch64/sys/vfork.S b/lib/libc/aarch64/sys/vfork.S
new file mode 100644
index 000000000000..daecd1f04a33
--- /dev/null
+++ b/lib/libc/aarch64/sys/vfork.S
@@ -0,0 +1,42 @@
+/*-
+ * Copyright (c) 2014 Andrew Turner
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+#include "SYS.h"
+
+ENTRY(__sys_vfork)
+ WEAK_REFERENCE(__sys_vfork, vfork)
+ WEAK_REFERENCE(__sys_vfork, _vfork)
+ mov x2, lr
+ _SYSCALL(vfork)
+ b.cs cerror
+ sub x1, x1, #1
+ and x0, x0, x1
+ mov lr, x2
+ ret
+END(__sys_vfork)
diff --git a/lib/libc/amd64/sys/Makefile.inc b/lib/libc/amd64/sys/Makefile.inc
index 8e0d6141043c..46ea9550950f 100644
--- a/lib/libc/amd64/sys/Makefile.inc
+++ b/lib/libc/amd64/sys/Makefile.inc
@@ -11,6 +11,3 @@ MDASM= vfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
PSEUDO= _getlogin.o _exit.o
-.if ${MK_SYSCALL_COMPAT} != "no"
-PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
-.endif
diff --git a/lib/libc/arm/SYS.h b/lib/libc/arm/SYS.h
index ed1a045c64e2..3254c4585561 100644
--- a/lib/libc/arm/SYS.h
+++ b/lib/libc/arm/SYS.h
@@ -62,6 +62,7 @@
#define _SYSCALL(x) \
_SYSCALL_NOERROR(x); \
+ it cs; \
bcs PIC_SYM(CERROR, PLT)
#define SYSCALL(x) \
@@ -72,6 +73,7 @@
.weak _C_LABEL(__CONCAT(_,x)); \
.set _C_LABEL(__CONCAT(_,x)),_C_LABEL(__CONCAT(__sys_,x)); \
SYSTRAP(x); \
+ it cs; \
bcs PIC_SYM(CERROR, PLT); \
RET
diff --git a/lib/libc/arm/aeabi/Makefile.inc b/lib/libc/arm/aeabi/Makefile.inc
index b204a53c7ca3..fa0ec8e9aee4 100644
--- a/lib/libc/arm/aeabi/Makefile.inc
+++ b/lib/libc/arm/aeabi/Makefile.inc
@@ -20,7 +20,7 @@ SRCS+= aeabi_vfp_double.S \
# libc. This causes issues when other parts of libc call these functions.
# We work around this by including these functions in libc but mark them as
# hidden so users of libc will not pick up these versions.
-.PATH: ${LIBC_SRCTOP}/../../contrib/compiler-rt/lib/arm
+.PATH: ${LIBC_SRCTOP}/../../contrib/compiler-rt/lib/builtins/arm
SRCS+= aeabi_memcmp.S \
aeabi_memcpy.S \
diff --git a/lib/libc/arm/aeabi/aeabi_vfp_double.S b/lib/libc/arm/aeabi/aeabi_vfp_double.S
index 62100d286222..aae49f85b940 100644
--- a/lib/libc/arm/aeabi/aeabi_vfp_double.S
+++ b/lib/libc/arm/aeabi/aeabi_vfp_double.S
@@ -66,6 +66,7 @@ AEABI_ENTRY(dcmpeq)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
+ ite ne
movne r0, #0
moveq r0, #1
RET
@@ -77,8 +78,9 @@ AEABI_ENTRY(dcmplt)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
+ ite cs
movcs r0, #0
- movlt r0, #1
+ movcc r0, #1
RET
AEABI_END(dcmplt)
@@ -88,6 +90,7 @@ AEABI_ENTRY(dcmple)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
+ ite hi
movhi r0, #0
movls r0, #1
RET
@@ -99,6 +102,7 @@ AEABI_ENTRY(dcmpge)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
+ ite lt
movlt r0, #0
movge r0, #1
RET
@@ -110,6 +114,7 @@ AEABI_ENTRY(dcmpgt)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
+ ite le
movle r0, #0
movgt r0, #1
RET
@@ -121,6 +126,7 @@ AEABI_ENTRY(dcmpun)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
+ ite vc
movvc r0, #0
movvs r0, #1
RET
diff --git a/lib/libc/arm/aeabi/aeabi_vfp_float.S b/lib/libc/arm/aeabi/aeabi_vfp_float.S
index c9a9a7ec2179..7de8daf4f32b 100644
--- a/lib/libc/arm/aeabi/aeabi_vfp_float.S
+++ b/lib/libc/arm/aeabi/aeabi_vfp_float.S
@@ -62,6 +62,7 @@ AEABI_ENTRY(fcmpeq)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
+ ite ne
movne r0, #0
moveq r0, #1
RET
@@ -72,8 +73,9 @@ AEABI_ENTRY(fcmplt)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
+ ite cs
movcs r0, #0
- movlt r0, #1
+ movcc r0, #1
RET
AEABI_END(fcmplt)
@@ -82,6 +84,7 @@ AEABI_ENTRY(fcmple)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
+ ite hi
movhi r0, #0
movls r0, #1
RET
@@ -92,6 +95,7 @@ AEABI_ENTRY(fcmpge)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
+ ite lt
movlt r0, #0
movge r0, #1
RET
@@ -102,6 +106,7 @@ AEABI_ENTRY(fcmpgt)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
+ ite le
movle r0, #0
movgt r0, #1
RET
@@ -112,6 +117,7 @@ AEABI_ENTRY(fcmpun)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
+ ite vc
movvc r0, #0
movvs r0, #1
RET
diff --git a/lib/libc/arm/gen/Makefile.inc b/lib/libc/arm/gen/Makefile.inc
index 8efde09ff3e0..c0f53927bc81 100644
--- a/lib/libc/arm/gen/Makefile.inc
+++ b/lib/libc/arm/gen/Makefile.inc
@@ -2,9 +2,10 @@
# $FreeBSD$
SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \
- getcontextx.c infinity.c ldexp.c makecontext.c \
+ infinity.c ldexp.c makecontext.c \
__aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S flt_rounds.c \
- arm_initfini.c
+ arm_initfini.c \
+ trivial-getcontextx.c
.if ${MACHINE_ARCH} == "armv6hf"
SRCS+= fpgetmask_vfp.c fpgetround_vfp.c fpgetsticky_vfp.c fpsetmask_vfp.c \
diff --git a/lib/libc/arm/gen/_setjmp.S b/lib/libc/arm/gen/_setjmp.S
index 387f8a92a501..3de9d99c56ec 100644
--- a/lib/libc/arm/gen/_setjmp.S
+++ b/lib/libc/arm/gen/_setjmp.S
@@ -85,7 +85,13 @@ ENTRY(_setjmp)
add r0, r0, #(_JB_REG_R4 * 4)
/* Store integer registers */
+#ifndef __thumb__
stmia r0, {r4-r14}
+#else
+ stmia r0, {r4-r12}
+ str r13, [r0, #((_JB_REG_R13 - _JB_REG_R4) * 4)]
+ str r14, [r0, #((_JB_REG_R14 - _JB_REG_R4) * 4)]
+#endif
mov r0, #0x00000000
RET
@@ -120,15 +126,24 @@ ENTRY(_longjmp)
add r0, r0, #(_JB_REG_R4 * 4)
/* Restore integer registers */
+#ifndef __thumb__
ldmia r0, {r4-r14}
+#else
+ ldmia r0, {r4-r12}
+ ldr r13, [r0, #((_JB_REG_R13 - _JB_REG_R4) * 4)]
+ ldr r14, [r0, #((_JB_REG_R14 - _JB_REG_R4) * 4)]
+#endif
/* Validate sp and r14 */
teq sp, #0
+ it ne
teqne r14, #0
+ it eq
beq botch
/* Set return value */
movs r0, r1
+ it eq
moveq r0, #0x00000001
RET
@@ -137,7 +152,7 @@ botch:
#if !defined(_STANDALONE)
bl PIC_SYM(_C_LABEL(longjmperror), PLT)
bl PIC_SYM(_C_LABEL(abort), PLT)
- b . - 8 /* Cannot get here */
+1: b 1b /* Cannot get here */
#else
b .
#endif
diff --git a/lib/libc/arm/gen/setjmp.S b/lib/libc/arm/gen/setjmp.S
index ad4ba38f8f86..62695634a480 100644
--- a/lib/libc/arm/gen/setjmp.S
+++ b/lib/libc/arm/gen/setjmp.S
@@ -90,7 +90,13 @@ ENTRY(setjmp)
/* Store integer registers */
add r0, r0, #(_JB_REG_R4 * 4)
+#ifndef __thumb__
stmia r0, {r4-r14}
+#else
+ stmia r0, {r4-r12}
+ str r13, [r0, #((_JB_REG_R13 - _JB_REG_R4) * 4)]
+ str r14, [r0, #((_JB_REG_R14 - _JB_REG_R4) * 4)]
+#endif
mov r0, #0x00000000
RET
@@ -133,15 +139,24 @@ ENTRY(__longjmp)
add r0, r0, #(_JB_REG_R4 * 4)
/* Restore integer registers */
+#ifndef __thumb__
ldmia r0, {r4-r14}
+#else
+ ldmia r0, {r4-r12}
+ ldr r13, [r0, #((_JB_REG_R13 - _JB_REG_R4) * 4)]
+ ldr r14, [r0, #((_JB_REG_R14 - _JB_REG_R4) * 4)]
+#endif
/* Validate sp and r14 */
teq sp, #0
+ it ne
teqne r14, #0
+ it eq
beq .Lbotch
/* Set return value */
movs r0, r1
+ it eq
moveq r0, #0x00000001
RET
@@ -149,5 +164,5 @@ ENTRY(__longjmp)
.Lbotch:
bl PIC_SYM(_C_LABEL(longjmperror), PLT)
bl PIC_SYM(_C_LABEL(abort), PLT)
- b . - 8 /* Cannot get here */
+1: b 1b /* Cannot get here */
END(__longjmp)
diff --git a/lib/libc/arm/string/ffs.S b/lib/libc/arm/string/ffs.S
index d3684ed417bc..4567f6c9ca3d 100644
--- a/lib/libc/arm/string/ffs.S
+++ b/lib/libc/arm/string/ffs.S
@@ -32,6 +32,8 @@
__FBSDID("$FreeBSD$");
+.syntax unified
+
/*
* ffs - find first set bit, this algorithm isolates the first set
* bit, then multiplies the number by 0x0450fbaf which leaves the top
@@ -60,7 +62,7 @@ ENTRY(ffs)
rsbne r0, r0, r0, lsl #16 /* r0 = X * 0x0450fbaf */
/* now lookup in table indexed on top 6 bits of r0 */
- ldrneb r0, [ r2, r0, lsr #26 ]
+ ldrbne r0, [ r2, r0, lsr #26 ]
RET
.text;
diff --git a/lib/libc/arm/string/memcmp.S b/lib/libc/arm/string/memcmp.S
index 63a00ef1bfc4..6fd8130f79b0 100644
--- a/lib/libc/arm/string/memcmp.S
+++ b/lib/libc/arm/string/memcmp.S
@@ -66,6 +66,8 @@
__FBSDID("$FreeBSD$");
+.syntax unified
+
ENTRY(memcmp)
mov ip, r0
#if defined(_KERNEL) && !defined(_STANDALONE)
@@ -76,7 +78,7 @@ ENTRY(memcmp)
/* Are both addresses aligned the same way? */
cmp r2, #0x00
- eornes r3, ip, r1
+ eorsne r3, ip, r1
RETeq /* len == 0, or same addresses! */
tst r3, #0x03
subne r2, r2, #0x01
diff --git a/lib/libc/arm/string/memcpy_arm.S b/lib/libc/arm/string/memcpy_arm.S
index eff1eb076549..56fb70314d11 100644
--- a/lib/libc/arm/string/memcpy_arm.S
+++ b/lib/libc/arm/string/memcpy_arm.S
@@ -31,6 +31,9 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
+
+.syntax unified
+
/*
* This is one fun bit of code ...
* Some easy listening music is suggested while trying to understand this
@@ -91,8 +94,8 @@ ENTRY(memcpy)
bge .Lmemcpy_loop32
cmn r2, #0x10
- ldmgeia r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
- stmgeia r0!, {r3, r4, r12, lr}
+ ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
+ stmiage r0!, {r3, r4, r12, lr}
subge r2, r2, #0x10
ldmia sp!, {r4} /* return r4 */
@@ -101,9 +104,9 @@ ENTRY(memcpy)
/* blat 12 bytes at a time */
.Lmemcpy_loop12:
- ldmgeia r1!, {r3, r12, lr}
- stmgeia r0!, {r3, r12, lr}
- subges r2, r2, #0x0c
+ ldmiage r1!, {r3, r12, lr}
+ stmiage r0!, {r3, r12, lr}
+ subsge r2, r2, #0x0c
bge .Lmemcpy_loop12
.Lmemcpy_l12:
@@ -113,26 +116,26 @@ ENTRY(memcpy)
subs r2, r2, #4
ldrlt r3, [r1], #4
strlt r3, [r0], #4
- ldmgeia r1!, {r3, r12}
- stmgeia r0!, {r3, r12}
+ ldmiage r1!, {r3, r12}
+ stmiage r0!, {r3, r12}
subge r2, r2, #4
.Lmemcpy_l4:
/* less than 4 bytes to go */
adds r2, r2, #4
#ifdef __APCS_26_
- ldmeqia sp!, {r0, pc}^ /* done */
+ ldmiaeq sp!, {r0, pc}^ /* done */
#else
- ldmeqia sp!, {r0, pc} /* done */
+ ldmiaeq sp!, {r0, pc} /* done */
#endif
/* copy the crud byte at a time */
cmp r2, #2
ldrb r3, [r1], #1
strb r3, [r0], #1
- ldrgeb r3, [r1], #1
- strgeb r3, [r0], #1
- ldrgtb r3, [r1], #1
- strgtb r3, [r0], #1
+ ldrbge r3, [r1], #1
+ strbge r3, [r0], #1
+ ldrbgt r3, [r1], #1
+ strbgt r3, [r0], #1
ldmia sp!, {r0, pc}
/* erg - unaligned destination */
@@ -143,10 +146,10 @@ ENTRY(memcpy)
/* align destination with byte copies */
ldrb r3, [r1], #1
strb r3, [r0], #1
- ldrgeb r3, [r1], #1
- strgeb r3, [r0], #1
- ldrgtb r3, [r1], #1
- strgtb r3, [r0], #1
+ ldrbge r3, [r1], #1
+ strbge r3, [r0], #1
+ ldrbgt r3, [r1], #1
+ strbgt r3, [r0], #1
subs r2, r2, r12
blt .Lmemcpy_l4 /* less the 4 bytes */
diff --git a/lib/libc/arm/string/memcpy_xscale.S b/lib/libc/arm/string/memcpy_xscale.S
index 1f48cd962d69..a451de46bc44 100644
--- a/lib/libc/arm/string/memcpy_xscale.S
+++ b/lib/libc/arm/string/memcpy_xscale.S
@@ -38,6 +38,8 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
+.syntax unified
+
/* LINTSTUB: Func: void *memcpy(void *dst, const void *src, size_t len) */
ENTRY(memcpy)
pld [r1]
@@ -52,12 +54,12 @@ ENTRY(memcpy)
ldrb ip, [r1], #0x01
sub r2, r2, #0x01
strb ip, [r3], #0x01
- ldrleb ip, [r1], #0x01
+ ldrble ip, [r1], #0x01
suble r2, r2, #0x01
- strleb ip, [r3], #0x01
- ldrltb ip, [r1], #0x01
+ strble ip, [r3], #0x01
+ ldrblt ip, [r1], #0x01
sublt r2, r2, #0x01
- strltb ip, [r3], #0x01
+ strblt ip, [r3], #0x01
/* Destination buffer is now word aligned */
.Lmemcpy_wordaligned:
@@ -134,7 +136,7 @@ ENTRY(memcpy)
.Lmemcpy_w_lessthan128:
adds r2, r2, #0x80 /* Adjust for extra sub */
- ldmeqfd sp!, {r4-r9}
+ ldmfdeq sp!, {r4-r9}
bxeq lr /* Return now if done */
subs r2, r2, #0x20
blt .Lmemcpy_w_lessthan32
@@ -159,7 +161,7 @@ ENTRY(memcpy)
.Lmemcpy_w_lessthan32:
adds r2, r2, #0x20 /* Adjust for extra sub */
- ldmeqfd sp!, {r4-r9}
+ ldmfdeq sp!, {r4-r9}
bxeq lr /* Return now if done */
and r4, r2, #0x18
@@ -195,11 +197,11 @@ ENTRY(memcpy)
addlt r2, r2, #0x04
ldrb ip, [r1], #0x01
cmp r2, #0x02
- ldrgeb r2, [r1], #0x01
+ ldrbge r2, [r1], #0x01
strb ip, [r3], #0x01
- ldrgtb ip, [r1]
- strgeb r2, [r3], #0x01
- strgtb ip, [r3]
+ ldrbgt ip, [r1]
+ strbge r2, [r3], #0x01
+ strbgt ip, [r3]
bx lr
@@ -253,7 +255,7 @@ ENTRY(memcpy)
bge .Lmemcpy_bad1_loop16
adds r2, r2, #0x10
- ldmeqfd sp!, {r4-r7}
+ ldmfdeq sp!, {r4-r7}
bxeq lr /* Return now if done */
subs r2, r2, #0x04
sublt r1, r1, #0x03
@@ -314,7 +316,7 @@ ENTRY(memcpy)
bge .Lmemcpy_bad2_loop16
adds r2, r2, #0x10
- ldmeqfd sp!, {r4-r7}
+ ldmfdeq sp!, {r4-r7}
bxeq lr /* Return now if done */
subs r2, r2, #0x04
sublt r1, r1, #0x02
@@ -375,7 +377,7 @@ ENTRY(memcpy)
bge .Lmemcpy_bad3_loop16
adds r2, r2, #0x10
- ldmeqfd sp!, {r4-r7}
+ ldmfdeq sp!, {r4-r7}
bxeq lr /* Return now if done */
subs r2, r2, #0x04
sublt r1, r1, #0x01
@@ -404,11 +406,11 @@ ENTRY(memcpy)
bxeq lr
ldrb ip, [r1], #0x01
cmp r2, #0x02
- ldrgeb r2, [r1], #0x01
+ ldrbge r2, [r1], #0x01
strb ip, [r3], #0x01
- ldrgtb ip, [r1]
- strgeb r2, [r3], #0x01
- strgtb ip, [r3]
+ ldrbgt ip, [r1]
+ strbge r2, [r3], #0x01
+ strbgt ip, [r3]
bx lr
@@ -440,7 +442,7 @@ ENTRY(memcpy)
ldrb ip, [r1], #0x01
1: subs r2, r2, #0x01
strb ip, [r3], #0x01
- ldrneb ip, [r1], #0x01
+ ldrbne ip, [r1], #0x01
bne 1b
bx lr
diff --git a/lib/libc/arm/string/memmove.S b/lib/libc/arm/string/memmove.S
index 75a274492437..94e5474000b0 100644
--- a/lib/libc/arm/string/memmove.S
+++ b/lib/libc/arm/string/memmove.S
@@ -32,6 +32,8 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
+.syntax unified
+
#ifndef _BCOPY
/* LINTSTUB: Func: void *memmove(void *, const void *, size_t) */
ENTRY(memmove)
@@ -86,8 +88,8 @@ ENTRY(bcopy)
bge .Lmemmove_floop32
cmn r2, #0x10
- ldmgeia r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
- stmgeia r0!, {r3, r4, r12, lr}
+ ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
+ stmiage r0!, {r3, r4, r12, lr}
subge r2, r2, #0x10
ldmia sp!, {r4} /* return r4 */
@@ -96,9 +98,9 @@ ENTRY(bcopy)
/* blat 12 bytes at a time */
.Lmemmove_floop12:
- ldmgeia r1!, {r3, r12, lr}
- stmgeia r0!, {r3, r12, lr}
- subges r2, r2, #0x0c
+ ldmiage r1!, {r3, r12, lr}
+ stmiage r0!, {r3, r12, lr}
+ subsge r2, r2, #0x0c
bge .Lmemmove_floop12
.Lmemmove_fl12:
@@ -108,23 +110,23 @@ ENTRY(bcopy)
subs r2, r2, #4
ldrlt r3, [r1], #4
strlt r3, [r0], #4
- ldmgeia r1!, {r3, r12}
- stmgeia r0!, {r3, r12}
+ ldmiage r1!, {r3, r12}
+ stmiage r0!, {r3, r12}
subge r2, r2, #4
.Lmemmove_fl4:
/* less than 4 bytes to go */
adds r2, r2, #4
- ldmeqia sp!, {r0, pc} /* done */
+ ldmiaeq sp!, {r0, pc} /* done */
/* copy the crud byte at a time */
cmp r2, #2
ldrb r3, [r1], #1
strb r3, [r0], #1
- ldrgeb r3, [r1], #1
- strgeb r3, [r0], #1
- ldrgtb r3, [r1], #1
- strgtb r3, [r0], #1
+ ldrbge r3, [r1], #1
+ strbge r3, [r0], #1
+ ldrbgt r3, [r1], #1
+ strbgt r3, [r0], #1
ldmia sp!, {r0, pc}
/* erg - unaligned destination */
@@ -135,10 +137,10 @@ ENTRY(bcopy)
/* align destination with byte copies */
ldrb r3, [r1], #1
strb r3, [r0], #1
- ldrgeb r3, [r1], #1
- strgeb r3, [r0], #1
- ldrgtb r3, [r1], #1
- strgtb r3, [r0], #1
+ ldrbge r3, [r1], #1
+ strbge r3, [r0], #1
+ ldrbgt r3, [r1], #1
+ strbgt r3, [r0], #1
subs r2, r2, r12
blt .Lmemmove_fl4 /* less the 4 bytes */
@@ -353,12 +355,12 @@ ENTRY(bcopy)
.Lmemmove_bl32:
cmn r2, #0x10
- ldmgedb r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
- stmgedb r0!, {r3, r4, r12, lr}
+ ldmdbge r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
+ stmdbge r0!, {r3, r4, r12, lr}
subge r2, r2, #0x10
adds r2, r2, #0x14
- ldmgedb r1!, {r3, r12, lr} /* blat a remaining 12 bytes */
- stmgedb r0!, {r3, r12, lr}
+ ldmdbge r1!, {r3, r12, lr} /* blat a remaining 12 bytes */
+ stmdbge r0!, {r3, r12, lr}
subge r2, r2, #0x0c
ldmia sp!, {r4, lr}
@@ -368,8 +370,8 @@ ENTRY(bcopy)
subs r2, r2, #4
ldrlt r3, [r1, #-4]!
strlt r3, [r0, #-4]!
- ldmgedb r1!, {r3, r12}
- stmgedb r0!, {r3, r12}
+ ldmdbge r1!, {r3, r12}
+ stmdbge r0!, {r3, r12}
subge r2, r2, #4
.Lmemmove_bl4:
@@ -381,10 +383,10 @@ ENTRY(bcopy)
cmp r2, #2
ldrb r3, [r1, #-1]!
strb r3, [r0, #-1]!
- ldrgeb r3, [r1, #-1]!
- strgeb r3, [r0, #-1]!
- ldrgtb r3, [r1, #-1]!
- strgtb r3, [r0, #-1]!
+ ldrbge r3, [r1, #-1]!
+ strbge r3, [r0, #-1]!
+ ldrbgt r3, [r1, #-1]!
+ strbgt r3, [r0, #-1]!
RET
/* erg - unaligned destination */
@@ -394,10 +396,10 @@ ENTRY(bcopy)
/* align destination with byte copies */
ldrb r3, [r1, #-1]!
strb r3, [r0, #-1]!
- ldrgeb r3, [r1, #-1]!
- strgeb r3, [r0, #-1]!
- ldrgtb r3, [r1, #-1]!
- strgtb r3, [r0, #-1]!
+ ldrbge r3, [r1, #-1]!
+ strbge r3, [r0, #-1]!
+ ldrbgt r3, [r1, #-1]!
+ strbgt r3, [r0, #-1]!
subs r2, r2, r12
blt .Lmemmove_bl4 /* less than 4 bytes to go */
ands r12, r1, #3
diff --git a/lib/libc/arm/string/memset.S b/lib/libc/arm/string/memset.S
index 458f8f7d73ff..66af33ec07dd 100644
--- a/lib/libc/arm/string/memset.S
+++ b/lib/libc/arm/string/memset.S
@@ -69,6 +69,8 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
+.syntax unified
+
/*
* memset: Sets a block of memory to the specified value
*
@@ -125,39 +127,39 @@ ENTRY(memset)
.Lmemset_loop128:
subs r1, r1, #0x80
#ifdef _ARM_ARCH_5E
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
#else
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
#endif
bgt .Lmemset_loop128
RETeq /* Zero length so just exit */
@@ -168,15 +170,15 @@ ENTRY(memset)
.Lmemset_loop32:
subs r1, r1, #0x20
#ifdef _ARM_ARCH_5E
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
#else
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
#endif
bgt .Lmemset_loop32
RETeq /* Zero length so just exit */
@@ -185,11 +187,11 @@ ENTRY(memset)
/* Deal with 16 bytes or more */
#ifdef _ARM_ARCH_5E
- strged r2, [ip], #0x08
- strged r2, [ip], #0x08
+ strdge r2, [ip], #0x08
+ strdge r2, [ip], #0x08
#else
- stmgeia ip!, {r2-r3}
- stmgeia ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
+ stmiage ip!, {r2-r3}
#endif
RETeq /* Zero length so just exit */
@@ -212,17 +214,17 @@ ENTRY(memset)
#endif
strb r3, [ip], #0x01 /* Set 1 byte */
- strgeb r3, [ip], #0x01 /* Set another byte */
- strgtb r3, [ip] /* and a third */
+ strbge r3, [ip], #0x01 /* Set another byte */
+ strbgt r3, [ip] /* and a third */
RET /* Exit */
.Lmemset_wordunaligned:
rsb r2, r2, #0x004
strb r3, [ip], #0x01 /* Set 1 byte */
cmp r2, #0x02
- strgeb r3, [ip], #0x01 /* Set another byte */
+ strbge r3, [ip], #0x01 /* Set another byte */
sub r1, r1, r2
- strgtb r3, [ip], #0x01 /* and a third */
+ strbgt r3, [ip], #0x01 /* and a third */
cmp r1, #0x04 /* More than 4 bytes left? */
bge .Lmemset_wordaligned /* Yup */
@@ -231,8 +233,8 @@ ENTRY(memset)
RETeq /* Zero length so exit */
strb r3, [ip], #0x01 /* Set 1 byte */
cmp r1, #0x02
- strgeb r3, [ip], #0x01 /* Set another byte */
- strgtb r3, [ip] /* and a third */
+ strbge r3, [ip], #0x01 /* Set another byte */
+ strbgt r3, [ip] /* and a third */
RET /* Exit */
#ifdef _BZERO
END(bzero)
diff --git a/lib/libc/arm/string/strlen.S b/lib/libc/arm/string/strlen.S
index 3d7726fb52ef..7447710d16b1 100644
--- a/lib/libc/arm/string/strlen.S
+++ b/lib/libc/arm/string/strlen.S
@@ -27,6 +27,8 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
+.syntax unified
+
ENTRY(strlen)
mov r1, #0
/* Check that the pointer is aligned on 32 bits. */
@@ -53,23 +55,23 @@ ENTRY(strlen)
addne r1, r1, #1
.Ldo_3:
#ifndef __ARMEB__
- andnes r3, r2, #0x0000ff00
+ andsne r3, r2, #0x0000ff00
#else
- andnes r3, r2, #0x00ff0000
+ andsne r3, r2, #0x00ff0000
#endif
addne r1, r1, #1
.Ldo_2:
#ifndef __ARMEB__
- andnes r3, r2, #0x00ff0000
+ andsne r3, r2, #0x00ff0000
#else
- andnes r3, r2, #0x0000ff00
+ andsne r3, r2, #0x0000ff00
#endif
addne r1, r1, #1
.Ldo_1:
#ifndef __ARMEB__
- andnes r3, r2, #0xff000000
+ andsne r3, r2, #0xff000000
#else
- andnes r3, r2, #0x000000ff
+ andsne r3, r2, #0x000000ff
#endif
addne r1, r1, #1
bne .Loop
diff --git a/lib/libc/arm/sys/Makefile.inc b/lib/libc/arm/sys/Makefile.inc
index 069aad343ac9..60c2dc3c6f43 100644
--- a/lib/libc/arm/sys/Makefile.inc
+++ b/lib/libc/arm/sys/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-SRCS+= __vdso_gettc.c
+SRCS+= trivial-vdso_tc.c
MDASM= Ovfork.S brk.S cerror.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S
@@ -8,6 +8,3 @@ MDASM= Ovfork.S brk.S cerror.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S syscal
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
PSEUDO= _exit.o _getlogin.o
-.if ${MK_SYSCALL_COMPAT} != "no"
-PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
-.endif
diff --git a/lib/libc/arm/sys/brk.S b/lib/libc/arm/sys/brk.S
index f3d8d8751524..e5f833637d09 100644
--- a/lib/libc/arm/sys/brk.S
+++ b/lib/libc/arm/sys/brk.S
@@ -53,16 +53,10 @@ _C_LABEL(minbrk):
* Change the data segment size
*/
ENTRY(_brk)
-#ifdef PIC
/* Setup the GOT */
- ldr r3, .Lgot
- add r3, pc, r3
-.L1:
- ldr r1, .Lminbrk
- ldr r1, [r3, r1]
-#else
- ldr r1, .Lminbrk
-#endif
+ GOT_INIT(r3, .Lgot, .L1)
+ GOT_GET(r1, r3, .Lminbrk)
+
/* Get the minimum allowable brk address */
ldr r1, [r1]
@@ -71,6 +65,7 @@ ENTRY(_brk)
* if the address is below minbrk.
*/
cmp r0, r1
+ it lt
movlt r0, r1
mov r2, r0
SYSTRAP(break)
@@ -90,10 +85,7 @@ ENTRY(_brk)
RET
.align 2
-#ifdef PIC
-.Lgot:
- .word _GLOBAL_OFFSET_TABLE_ - (.L1+4)
-#endif
+ GOT_INITSYM(.Lgot, .L1)
.Lminbrk:
.word PIC_SYM(_C_LABEL(minbrk), GOT)
.Lcurbrk:
diff --git a/lib/libc/arm/sys/sbrk.S b/lib/libc/arm/sys/sbrk.S
index 7d22aa7d7ce0..5cd9a03e3a80 100644
--- a/lib/libc/arm/sys/sbrk.S
+++ b/lib/libc/arm/sys/sbrk.S
@@ -52,16 +52,10 @@ CURBRK:
* Change the data segment size
*/
ENTRY(_sbrk)
-#ifdef PIC
/* Setup the GOT */
- ldr r3, .Lgot
- add r3, pc, r3
-.L1:
- ldr r2, .Lcurbrk
- ldr r2, [r3, r2]
-#else
- ldr r2, .Lcurbrk
-#endif
+ GOT_INIT(r3, .Lgot, .L1)
+ GOT_GET(r2, r3, .Lcurbrk)
+
/* Get the current brk address */
ldr r1, [r2]
@@ -80,10 +74,7 @@ ENTRY(_sbrk)
RET
.align 0
-#ifdef PIC
-.Lgot:
- .word _GLOBAL_OFFSET_TABLE_ - (.L1+4)
-#endif
+ GOT_INITSYM(.Lgot, .L1)
.Lcurbrk:
.word PIC_SYM(CURBRK, GOT)
END(_sbrk)
diff --git a/lib/libc/compat-43/creat.c b/lib/libc/compat-43/creat.c
index fc3be060bf60..45454824ba6b 100644
--- a/lib/libc/compat-43/creat.c
+++ b/lib/libc/compat-43/creat.c
@@ -36,11 +36,18 @@ __FBSDID("$FreeBSD$");
#include "namespace.h"
#include <fcntl.h>
#include "un-namespace.h"
+#include "libc_private.h"
+__weak_reference(__creat, creat);
+__weak_reference(__creat, _creat);
+
+#pragma weak creat
int
__creat(const char *path, mode_t mode)
{
- return(_open(path, O_WRONLY|O_CREAT|O_TRUNC, mode));
+
+ return (((int (*)(int, const char *, int, ...))
+ __libc_interposing[INTERPOS_openat])(AT_FDCWD, path, O_WRONLY |
+ O_CREAT | O_TRUNC, mode));
}
-__weak_reference(__creat, creat);
-__weak_reference(__creat, _creat);
+
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index af80929112b0..e6da5fea4786 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -808,7 +808,7 @@ __expand_table(HTAB *hashp)
hashp->DSIZE = dirsize << 1;
}
if ((hashp->dir[new_segnum] =
- (SEGMENT)calloc(hashp->SGSIZE, sizeof(SEGMENT))) == NULL)
+ calloc(hashp->SGSIZE, sizeof(SEGMENT))) == NULL)
return (-1);
hashp->exsegs++;
hashp->nsegs++;
@@ -877,7 +877,7 @@ alloc_segs(HTAB *hashp, int nsegs)
int save_errno;
if ((hashp->dir =
- (SEGMENT *)calloc(hashp->DSIZE, sizeof(SEGMENT *))) == NULL) {
+ calloc(hashp->DSIZE, sizeof(SEGMENT *))) == NULL) {
save_errno = errno;
(void)hdestroy(hashp);
errno = save_errno;
@@ -887,8 +887,7 @@ alloc_segs(HTAB *hashp, int nsegs)
if (nsegs == 0)
return (0);
/* Allocate segments */
- if ((store = (SEGMENT)calloc(nsegs << hashp->SSHIFT,
- sizeof(SEGMENT))) == NULL) {
+ if ((store = calloc(nsegs << hashp->SSHIFT, sizeof(SEGMENT))) == NULL) {
save_errno = errno;
(void)hdestroy(hashp);
errno = save_errno;
diff --git a/lib/libc/db/man/dbm.3 b/lib/libc/db/man/dbm.3
index fabce8a8f2c1..eedf804abfdd 100644
--- a/lib/libc/db/man/dbm.3
+++ b/lib/libc/db/man/dbm.3
@@ -15,7 +15,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 16, 2006
+.Dd February 19, 2015
.Dt DBM 3
.Os
.Sh NAME
@@ -174,9 +174,7 @@ deletes the entry for
The
.Fn dbm_delete
function
-normally returns zero but returns 1 if there was no entry with
-.Fa key
-in the database or returns -1 and sets
+normally returns zero or returns -1 and sets
.Va errno
if there were any errors.
.Pp
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index f64caf0d54bd..2232b795bc91 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -5,6 +5,7 @@
.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen
SRCS+= __getosreldate.c \
+ __pthread_mutex_init_calloc_cb_stub.c \
__xuname.c \
_once_stub.c \
_pthread_stubs.c \
diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map
index 77413d619d68..ee4d6197e150 100644
--- a/lib/libc/gen/Symbol.map
+++ b/lib/libc/gen/Symbol.map
@@ -487,6 +487,7 @@ FBSDprivate_1.0 {
_rtld_atfork_post;
_rtld_error; /* for private use */
_rtld_get_stack_prot;
+ _rtld_is_dlopened;
_rtld_thread_init; /* for private use */
__elf_phdr_match_addr;
_err;
@@ -532,6 +533,8 @@ FBSDprivate_1.0 {
_libc_sem_post_compat;
_libc_sem_getvalue_compat;
+ __libc_tcdrain;
+
__elf_aux_vector;
__pthread_map_stacks_exec;
__fillcontextx;
diff --git a/lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c b/lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c
new file mode 100644
index 000000000000..1c566ecf4809
--- /dev/null
+++ b/lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014 The FreeBSD Foundation.
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice(s), this list of conditions and the following disclaimer as
+ * the first lines of this file unmodified other than the possible
+ * addition of one or more copyright notices.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice(s), this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <pthread.h>
+#include "libc_private.h"
+
+int
+_pthread_mutex_init_calloc_cb_stub(pthread_mutex_t *mutex,
+ void *(calloc_cb)(size_t, size_t))
+{
+
+ return (0);
+}
diff --git a/lib/libc/gen/_once_stub.c b/lib/libc/gen/_once_stub.c
index d2acc29f32c2..c45565a79cbd 100644
--- a/lib/libc/gen/_once_stub.c
+++ b/lib/libc/gen/_once_stub.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2009 Advanced Computing Technologies LLC
+ * Copyright (c) 2009 Hudson River Trading LLC
* Written by: John H. Baldwin <jhb@FreeBSD.org>
* All rights reserved.
*
diff --git a/lib/libc/gen/_spinlock_stub.c b/lib/libc/gen/_spinlock_stub.c
index 47bbfeb3fbdc..3decf8a0a565 100644
--- a/lib/libc/gen/_spinlock_stub.c
+++ b/lib/libc/gen/_spinlock_stub.c
@@ -33,51 +33,48 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include "spinlock.h"
+#include "libc_private.h"
long _atomic_lock_stub(volatile long *);
void _spinlock_stub(spinlock_t *);
void _spinunlock_stub(spinlock_t *);
void _spinlock_debug_stub(spinlock_t *, char *, int);
-/*
- * Declare weak definitions in case the application is not linked
- * with libpthread.
- */
__weak_reference(_atomic_lock_stub, _atomic_lock);
-__weak_reference(_spinlock_stub, _spinlock);
-__weak_reference(_spinunlock_stub, _spinunlock);
-__weak_reference(_spinlock_debug_stub, _spinlock_debug);
-/*
- * This function is a stub for the _atomic_lock function in libpthread.
- */
long
_atomic_lock_stub(volatile long *lck __unused)
{
return (0L);
}
+__weak_reference(_spinlock, _spinlock_debug);
+#pragma weak _spinlock
+void
+_spinlock(spinlock_t *lck)
+{
-/*
- * This function is a stub for the spinlock function in libpthread.
- */
+ ((void (*)(spinlock_t *lck))__libc_interposing[INTERPOS_spinlock])
+ (lck);
+
+}
+
+#pragma weak _spinunlock
void
-_spinlock_stub(spinlock_t *lck __unused)
+_spinunlock(spinlock_t *lck)
{
+
+ ((void (*)(spinlock_t *lck))__libc_interposing[INTERPOS_spinunlock])
+ (lck);
+
}
-/*
- * This function is a stub for the spinunlock function in libpthread.
- */
void
-_spinunlock_stub(spinlock_t *lck __unused)
+__libc_spinlock_stub(spinlock_t *lck __unused)
{
}
-/*
- * This function is a stub for the debug spinlock function in libpthread.
- */
void
-_spinlock_debug_stub(spinlock_t *lck __unused, char *fname __unused, int lineno __unused)
+__libc_spinunlock_stub(spinlock_t *lck __unused)
{
}
diff --git a/lib/libc/gen/cap_rights_get.3 b/lib/libc/gen/cap_rights_get.3
index f74d1f7aeda5..a665465e5339 100644
--- a/lib/libc/gen/cap_rights_get.3
+++ b/lib/libc/gen/cap_rights_get.3
@@ -100,10 +100,10 @@ argument points at an invalid address.
.El
.Sh SEE ALSO
.Xr cap_rights_limit 2 ,
-.Xr cap_rights_init 3 ,
.Xr errno 2 ,
.Xr open 2 ,
.Xr assert 3 ,
+.Xr cap_rights_init 3 ,
.Xr err 3 ,
.Xr memcmp 3 ,
.Xr memset 3 ,
diff --git a/lib/libc/gen/directory.3 b/lib/libc/gen/directory.3
index 1e864f8dcbc5..f0d0f4b97f0d 100644
--- a/lib/libc/gen/directory.3
+++ b/lib/libc/gen/directory.3
@@ -28,7 +28,7 @@
.\" @(#)directory.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd July 28, 2014
+.Dd May 6, 2015
.Dt DIRECTORY 3
.Os
.Sh NAME
@@ -263,8 +263,25 @@ function appeared in
function appeared in
.Fx 10.0 .
.Sh BUGS
-The invalidation of
+The behaviour of
.Fn telldir
-tokens when calling
+and
+.Fn seekdir
+is likely to be wrong if there are parallel unlinks happening
+and the directory is larger than one page.
+There is code to ensure that a
.Fn seekdir
-is non-standard.
+to the location given by a
+.Fn telldir
+immediately before the last
+.Fn readdir
+will always set the correct location to return the same value as that last
+.Fn readdir
+performed.
+This is enough for some applications which want to "push back the last entry read" E.g. Samba.
+Seeks back to any other location,
+other than the beginning of the directory,
+may result in unexpected behaviour if deletes are present.
+It is hoped that this situation will be resolved with changes to
+.Fn getdirentries
+and the VFS.
diff --git a/lib/libc/gen/disklabel.c b/lib/libc/gen/disklabel.c
index bd15a47318e0..8780573d1c5d 100644
--- a/lib/libc/gen/disklabel.c
+++ b/lib/libc/gen/disklabel.c
@@ -85,10 +85,13 @@ getdiskbyname(const char *name)
cq++, cp++;
*cq = '\0';
- if (cgetstr(buf, "ty", &cq) > 0 && strcmp(cq, "removable") == 0)
- dp->d_flags |= D_REMOVABLE;
- else if (cq && strcmp(cq, "simulated") == 0)
- dp->d_flags |= D_RAMDISK;
+ if (cgetstr(buf, "ty", &cq) > 0) {
+ if (strcmp(cq, "removable") == 0)
+ dp->d_flags |= D_REMOVABLE;
+ else if (cq && strcmp(cq, "simulated") == 0)
+ dp->d_flags |= D_RAMDISK;
+ free(cq);
+ }
if (cgetcap(buf, "sf", ':') != NULL)
dp->d_flags |= D_BADSECT;
@@ -100,9 +103,10 @@ getdiskbyname(const char *name)
getnumdflt(dp->d_nsectors, "ns", 0);
getnumdflt(dp->d_ncylinders, "nc", 0);
- if (cgetstr(buf, "dt", &cq) > 0)
+ if (cgetstr(buf, "dt", &cq) > 0) {
dp->d_type = gettype(cq, dktypenames);
- else
+ free(cq);
+ } else
getnumdflt(dp->d_type, "dt", 0);
getnumdflt(dp->d_secpercyl, "sc", dp->d_nsectors * dp->d_ntracks);
getnumdflt(dp->d_secperunit, "su", dp->d_secpercyl * dp->d_ncylinders);
@@ -140,8 +144,11 @@ getdiskbyname(const char *name)
pp->p_frag = 8;
}
getnumdflt(pp->p_fstype, ptype, 0);
- if (pp->p_fstype == 0 && cgetstr(buf, ptype, &cq) > 0)
- pp->p_fstype = gettype(cq, fstypenames);
+ if (pp->p_fstype == 0)
+ if (cgetstr(buf, ptype, &cq) >= 0) {
+ pp->p_fstype = gettype(cq, fstypenames);
+ free(cq);
+ }
max = p;
}
}
diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c
index ad24bb4914ca..7d287974fa25 100644
--- a/lib/libc/gen/dlfcn.c
+++ b/lib/libc/gen/dlfcn.c
@@ -149,10 +149,8 @@ static void
dl_init_phdr_info(void)
{
Elf_Auxinfo *auxp;
- size_t phent;
unsigned int i;
- phent = 0;
for (auxp = __elf_aux_vector; auxp->a_type != AT_NULL; auxp++) {
switch (auxp->a_type) {
case AT_BASE:
@@ -165,9 +163,6 @@ dl_init_phdr_info(void)
phdr_info.dlpi_phdr =
(const Elf_Phdr *)auxp->a_un.a_ptr;
break;
- case AT_PHENT:
- phent = auxp->a_un.a_val;
- break;
case AT_PHNUM:
phdr_info.dlpi_phnum = (Elf_Half)auxp->a_un.a_val;
break;
@@ -233,3 +228,10 @@ _rtld_get_stack_prot(void)
return (PROT_EXEC | PROT_READ | PROT_WRITE);
}
+#pragma weak _rtld_is_dlopened
+int
+_rtld_is_dlopened(void *arg)
+{
+
+ return (0);
+}
diff --git a/lib/libc/gen/dlopen.3 b/lib/libc/gen/dlopen.3
index 089e63192b0a..1963528b54bf 100644
--- a/lib/libc/gen/dlopen.3
+++ b/lib/libc/gen/dlopen.3
@@ -32,7 +32,7 @@
.\" @(#) dlopen.3 1.6 90/01/31 SMI
.\" $FreeBSD$
.\"
-.Dd December 21, 2011
+.Dd February 14, 2015
.Dt DLOPEN 3
.Os
.Sh NAME
@@ -236,7 +236,7 @@ as follows, in the given order:
The referencing object itself (or the object from which the call to
.Fn dlsym
is made), if that object was linked using the
-.Fl Wsymbolic
+.Fl Bsymbolic
option to
.Xr ld 1 .
.It
diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c
index 6a77abd635cf..c21ceb388904 100644
--- a/lib/libc/gen/fstab.c
+++ b/lib/libc/gen/fstab.c
@@ -181,7 +181,7 @@ fstabscan(void)
if (cp != NULL)
_fs_fstab.fs_passno = atoi(cp);
}
- strcpy(subline, _fs_fstab.fs_mntops);
+ (void)strlcpy(subline, _fs_fstab.fs_mntops, sizeof(subline));
p = subline;
for (typexx = 0, cp = strsep(&p, ","); cp;
cp = strsep(&p, ",")) {
diff --git a/lib/libc/gen/ftok.3 b/lib/libc/gen/ftok.3
index 98f8bad878f8..b819dbd185d4 100644
--- a/lib/libc/gen/ftok.3
+++ b/lib/libc/gen/ftok.3
@@ -64,9 +64,9 @@ function will return -1 if
.Fa path
does not exist or if it cannot be accessed by the calling process.
.Sh SEE ALSO
+.Xr msgget 2 ,
.Xr semget 2 ,
-.Xr shmget 2 ,
-.Xr msgget 2
+.Xr shmget 2
.Sh HISTORY
The
.Fn ftok
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index 7635fbc35263..1ca8334acc68 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -905,12 +905,13 @@ fts_stat(FTS *sp, FTSENT *p, int follow, int dfd)
if (ISSET(FTS_LOGICAL) || follow) {
if (fstatat(dfd, path, sbp, 0)) {
saved_errno = errno;
- if (!fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) {
- errno = 0;
- return (FTS_SLNONE);
+ if (fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) {
+ p->fts_errno = saved_errno;
+ goto err;
}
- p->fts_errno = saved_errno;
- goto err;
+ errno = 0;
+ if (S_ISLNK(sbp->st_mode))
+ return (FTS_SLNONE);
}
} else if (fstatat(dfd, path, sbp, AT_SYMLINK_NOFOLLOW)) {
p->fts_errno = errno;
diff --git a/lib/libc/gen/ftw.3 b/lib/libc/gen/ftw.3
index ba8859b4a330..df8abab031bd 100644
--- a/lib/libc/gen/ftw.3
+++ b/lib/libc/gen/ftw.3
@@ -87,8 +87,9 @@ A directory which cannot be read.
The directory will not be descended into.
.It Dv FTW_DP
A directory being visited in post-order
-.Fn ( nftw
-only).
+.Po Fn nftw
+only
+.Pc .
.It Dv FTW_NS
A file for which no
.Xr stat 2
@@ -100,8 +101,9 @@ structure are undefined.
A symbolic link.
.It Dv FTW_SLN
A symbolic link with a non-existent target
-.Fn ( nftw
-only).
+.Po Fn nftw
+only
+.Pc .
.El
.Pp
The
diff --git a/lib/libc/gen/getcap.3 b/lib/libc/gen/getcap.3
index 73826ae7c0dc..c3a9ce87a032 100644
--- a/lib/libc/gen/getcap.3
+++ b/lib/libc/gen/getcap.3
@@ -137,9 +137,10 @@ It must be called before the
call.
If a sequential access is being performed (see below), it must be called
before the first sequential access call
-.Fn ( cgetfirst
+.Po Fn cgetfirst
or
-.Fn cgetnext ) ,
+.Fn cgetnext
+.Pc ,
or be directly preceded by a
.Fn cgetclose
call.
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index f9480c3a22fc..1f4d7e9fb299 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -896,7 +896,7 @@ files_group(void *retval, void *mdata, va_list ap)
break;
pos = ftello(st->fp);
}
- if (!stayopen && st->fp != NULL) {
+ if (st->fp != NULL && !stayopen) {
fclose(st->fp);
st->fp = NULL;
}
@@ -1173,8 +1173,10 @@ nis_group(void *retval, void *mdata, va_list ap)
* terminator, alignment padding, and one (char *)
* pointer for the member list terminator.
*/
- if (resultlen >= bufsize - _ALIGNBYTES - sizeof(char *))
+ if (resultlen >= bufsize - _ALIGNBYTES - sizeof(char *)) {
+ free(result);
goto erange;
+ }
memcpy(buffer, result, resultlen);
buffer[resultlen] = '\0';
free(result);
@@ -1450,7 +1452,7 @@ docompat:
pos = ftello(st->fp);
}
fin:
- if (!stayopen && st->fp != NULL) {
+ if (st->fp != NULL && !stayopen) {
fclose(st->fp);
st->fp = NULL;
}
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index f729cdf1d417..09a624785a15 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -815,7 +815,7 @@ files_passwd(void *retval, void *mdata, va_list ap)
size_t bufsize, namesize;
uid_t uid;
uint32_t store;
- int rv, stayopen, *errnop;
+ int rv, stayopen = 0, *errnop;
name = NULL;
uid = (uid_t)-1;
@@ -921,7 +921,7 @@ files_passwd(void *retval, void *mdata, va_list ap)
errnop);
} while (how == nss_lt_all && !(rv & NS_TERMINATE));
fin:
- if (!stayopen && st->db != NULL) {
+ if (st->db != NULL && !stayopen) {
(void)st->db->close(st->db);
st->db = NULL;
}
@@ -1392,8 +1392,10 @@ nis_passwd(void *retval, void *mdata, va_list ap)
continue;
}
}
- if (resultlen >= bufsize)
+ if (resultlen >= bufsize) {
+ free(result);
goto erange;
+ }
memcpy(buffer, result, resultlen);
buffer[resultlen] = '\0';
free(result);
@@ -1940,7 +1942,7 @@ docompat:
break;
}
fin:
- if (!stayopen && st->db != NULL) {
+ if (st->db != NULL && !stayopen) {
(void)st->db->close(st->db);
st->db = NULL;
}
diff --git a/lib/libc/gen/getutxent.3 b/lib/libc/gen/getutxent.3
index 120f4a08b8e1..85c37b16e0fc 100644
--- a/lib/libc/gen/getutxent.3
+++ b/lib/libc/gen/getutxent.3
@@ -475,4 +475,4 @@ They replaced the
.In utmp.h
interface.
.Sh AUTHORS
-.An Ed Schouten Aq Mt ed@FreeBSD.org
+.An \&Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/nice.3 b/lib/libc/gen/nice.3
index 9c39b78d341f..b04c8f4596b4 100644
--- a/lib/libc/gen/nice.3
+++ b/lib/libc/gen/nice.3
@@ -28,7 +28,7 @@
.\" @(#)nice.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 4, 1993
+.Dd February 28, 2015
.Dt NICE 3
.Os
.Sh NAME
@@ -48,20 +48,48 @@ This interface is obsoleted by
.Pp
The
.Fn nice
-function obtains the scheduling priority of the process
-from the system and sets it to the priority value specified in
-.Fa incr .
+function adds
+.Fa incr
+to the scheduling priority of the process.
The priority is a value in the range -20 to 20.
The default priority is 0; lower priorities cause more favorable scheduling.
Only the super-user may lower priorities.
.Pp
Children inherit the priority of their parent processes via
.Xr fork 2 .
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn nice
+returns 0, and
+.Va errno
+is unchanged.
+Otherwise, \-1 is returned, the process' nice value is not changed, and
+.Va errno
+is set to indicate the error.
+.Sh ERRORS
+The
+.Fn nice
+function will fail if:
+.Bl -tag -width Er
+.It Bq Er EPERM
+The
+.Fa incr
+argument is negative and the caller does not have appropriate privileges.
+.El
.Sh SEE ALSO
.Xr nice 1 ,
.Xr fork 2 ,
.Xr setpriority 2 ,
.Xr renice 8
+.Sh STANDARDS
+The
+.Fn nice
+function conforms to
+.St -p1003.1-2008
+except for the return value.
+This implementation returns 0 upon successful completion but
+the standard requires returning the new nice value,
+which could be \-1.
.Sh HISTORY
A
.Fn nice
diff --git a/lib/libc/gen/nice.c b/lib/libc/gen/nice.c
index e8375e891539..ba9524b5c6c0 100644
--- a/lib/libc/gen/nice.c
+++ b/lib/libc/gen/nice.c
@@ -43,14 +43,20 @@ __FBSDID("$FreeBSD$");
* Backwards compatible nice.
*/
int
-nice(incr)
- int incr;
+nice(int incr)
{
- int prio;
+ int saverrno, prio;
+ saverrno = errno;
errno = 0;
prio = getpriority(PRIO_PROCESS, 0);
- if (prio == -1 && errno)
+ if (prio == -1 && errno != 0)
return (-1);
- return (setpriority(PRIO_PROCESS, 0, prio + incr));
+ if (setpriority(PRIO_PROCESS, 0, prio + incr) == -1) {
+ if (errno == EACCES)
+ errno = EPERM;
+ return (-1);
+ }
+ errno = saverrno;
+ return (0);
}
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index bdadd55389c3..ec878c5bebc5 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -47,7 +47,10 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include "un-namespace.h"
+/* There is no a.out support on arm64 */
+#ifndef __aarch64__
#define _NLIST_DO_AOUT
+#endif
#define _NLIST_DO_ELF
#ifdef _NLIST_DO_ELF
diff --git a/lib/libc/gen/pause.c b/lib/libc/gen/pause.c
index 51706cf947e8..ef48c1cd4518 100644
--- a/lib/libc/gen/pause.c
+++ b/lib/libc/gen/pause.c
@@ -33,10 +33,10 @@ static char sccsid[] = "@(#)pause.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "namespace.h"
#include <signal.h>
#include <unistd.h>
-#include "un-namespace.h"
+
+#include "libc_private.h"
/*
* Backwards compatible pause.
@@ -46,9 +46,10 @@ __pause(void)
{
sigset_t oset;
- if (_sigprocmask(SIG_BLOCK, NULL, &oset) == -1)
+ if (sigprocmask(SIG_BLOCK, NULL, &oset) == -1)
return (-1);
- return (_sigsuspend(&oset));
+ return (sigsuspend(&oset));
}
+
__weak_reference(__pause, pause);
__weak_reference(__pause, _pause);
diff --git a/lib/libc/gen/posix_spawn.3 b/lib/libc/gen/posix_spawn.3
index dd5bd2b5ed88..2c9131b5b8c4 100644
--- a/lib/libc/gen/posix_spawn.3
+++ b/lib/libc/gen/posix_spawn.3
@@ -413,6 +413,10 @@ including trying to close a descriptor that is not open.
.Xr execve 2 ,
.Xr fcntl 2 ,
.Xr open 2 ,
+.Xr sched_setparam 2 ,
+.Xr sched_setscheduler 2 ,
+.Xr setpgid 2 ,
+.Xr vfork 2 ,
.Xr posix_spawn_file_actions_addclose 3 ,
.Xr posix_spawn_file_actions_adddup2 3 ,
.Xr posix_spawn_file_actions_addopen 3 ,
@@ -431,11 +435,7 @@ including trying to close a descriptor that is not open.
.Xr posix_spawnattr_setschedparam 3 ,
.Xr posix_spawnattr_setschedpolicy 3 ,
.Xr posix_spawnattr_setsigdefault 3 ,
-.Xr posix_spawnattr_setsigmask 3 ,
-.Xr sched_setparam 2 ,
-.Xr sched_setscheduler 2 ,
-.Xr setpgid 2 ,
-.Xr vfork 2
+.Xr posix_spawnattr_setsigmask 3
.Sh STANDARDS
The
.Fn posix_spawn
@@ -457,4 +457,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An Ed Schouten Aq Mt ed@FreeBSD.org
+.An \&Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawn_file_actions_addopen.3 b/lib/libc/gen/posix_spawn_file_actions_addopen.3
index b28f3960ef6b..0b57999bf4be 100644
--- a/lib/libc/gen/posix_spawn_file_actions_addopen.3
+++ b/lib/libc/gen/posix_spawn_file_actions_addopen.3
@@ -200,4 +200,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An Ed Schouten Aq Mt ed@FreeBSD.org
+.An \&Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawn_file_actions_init.3 b/lib/libc/gen/posix_spawn_file_actions_init.3
index eda2a1daa1e9..380eed769003 100644
--- a/lib/libc/gen/posix_spawn_file_actions_init.3
+++ b/lib/libc/gen/posix_spawn_file_actions_init.3
@@ -101,4 +101,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An Ed Schouten Aq Mt ed@FreeBSD.org
+.An \&Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_getflags.3 b/lib/libc/gen/posix_spawnattr_getflags.3
index b5995cea4a82..2571f4ab307c 100644
--- a/lib/libc/gen/posix_spawnattr_getflags.3
+++ b/lib/libc/gen/posix_spawnattr_getflags.3
@@ -108,4 +108,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An Ed Schouten Aq Mt ed@FreeBSD.org
+.An \&Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_getpgroup.3 b/lib/libc/gen/posix_spawnattr_getpgroup.3
index 91b3e5cd3d18..cfc1b54ab633 100644
--- a/lib/libc/gen/posix_spawnattr_getpgroup.3
+++ b/lib/libc/gen/posix_spawnattr_getpgroup.3
@@ -93,4 +93,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An Ed Schouten Aq Mt ed@FreeBSD.org
+.An \&Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_getschedparam.3 b/lib/libc/gen/posix_spawnattr_getschedparam.3
index a137200bd6ae..5eef96ea825d 100644
--- a/lib/libc/gen/posix_spawnattr_getschedparam.3
+++ b/lib/libc/gen/posix_spawnattr_getschedparam.3
@@ -97,4 +97,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An Ed Schouten Aq Mt ed@FreeBSD.org
+.An \&Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_getschedpolicy.3 b/lib/libc/gen/posix_spawnattr_getschedpolicy.3
index 3e79d4b79582..5276de5a2f35 100644
--- a/lib/libc/gen/posix_spawnattr_getschedpolicy.3
+++ b/lib/libc/gen/posix_spawnattr_getschedpolicy.3
@@ -95,4 +95,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An Ed Schouten Aq Mt ed@FreeBSD.org
+.An \&Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_getsigdefault.3 b/lib/libc/gen/posix_spawnattr_getsigdefault.3
index 88783322ff97..a81c71417449 100644
--- a/lib/libc/gen/posix_spawnattr_getsigdefault.3
+++ b/lib/libc/gen/posix_spawnattr_getsigdefault.3
@@ -95,4 +95,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An Ed Schouten Aq Mt ed@FreeBSD.org
+.An \&Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_getsigmask.3 b/lib/libc/gen/posix_spawnattr_getsigmask.3
index 4f9c014853af..be15d9d47d82 100644
--- a/lib/libc/gen/posix_spawnattr_getsigmask.3
+++ b/lib/libc/gen/posix_spawnattr_getsigmask.3
@@ -95,4 +95,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An Ed Schouten Aq Mt ed@FreeBSD.org
+.An \&Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawnattr_init.3 b/lib/libc/gen/posix_spawnattr_init.3
index 388fe5a49ce9..b4ec52c30e25 100644
--- a/lib/libc/gen/posix_spawnattr_init.3
+++ b/lib/libc/gen/posix_spawnattr_init.3
@@ -120,4 +120,4 @@ and
functions first appeared in
.Fx 8.0 .
.Sh AUTHORS
-.An Ed Schouten Aq Mt ed@FreeBSD.org
+.An \&Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/raise.c b/lib/libc/gen/raise.c
index b3d0aaed3ed2..994fea57911b 100644
--- a/lib/libc/gen/raise.c
+++ b/lib/libc/gen/raise.c
@@ -36,11 +36,17 @@ __FBSDID("$FreeBSD$");
#include <signal.h>
#include <unistd.h>
+#include "libc_private.h"
+
__weak_reference(__raise, raise);
__weak_reference(__raise, _raise);
int
__raise(int s)
{
- return(kill(getpid(), s));
+ long id;
+
+ if (__sys_thr_self(&id) == -1)
+ return (-1);
+ return (__sys_thr_kill(id, s));
}
diff --git a/lib/libc/gen/readdir.c b/lib/libc/gen/readdir.c
index 69f59d16087a..c6f5d3fd6c9b 100644
--- a/lib/libc/gen/readdir.c
+++ b/lib/libc/gen/readdir.c
@@ -54,19 +54,25 @@ _readdir_unlocked(dirp, skip)
int skip;
{
struct dirent *dp;
+ long initial_seek;
+ long initial_loc = 0;
for (;;) {
if (dirp->dd_loc >= dirp->dd_size) {
if (dirp->dd_flags & __DTF_READALL)
return (NULL);
+ initial_loc = dirp->dd_loc;
+ dirp->dd_flags &= ~__DTF_SKIPREAD;
dirp->dd_loc = 0;
}
if (dirp->dd_loc == 0 &&
!(dirp->dd_flags & (__DTF_READALL | __DTF_SKIPREAD))) {
+ initial_seek = dirp->dd_seek;
dirp->dd_size = _getdirentries(dirp->dd_fd,
dirp->dd_buf, dirp->dd_len, &dirp->dd_seek);
if (dirp->dd_size <= 0)
return (NULL);
+ _fixtelldir(dirp, initial_seek, initial_loc);
}
dirp->dd_flags &= ~__DTF_SKIPREAD;
dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc);
diff --git a/lib/libc/gen/rewinddir.c b/lib/libc/gen/rewinddir.c
index 193f4b0570da..e157cd682e1c 100644
--- a/lib/libc/gen/rewinddir.c
+++ b/lib/libc/gen/rewinddir.c
@@ -51,6 +51,7 @@ rewinddir(dirp)
if (__isthreaded)
_pthread_mutex_lock(&dirp->dd_lock);
+ dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */
if (dirp->dd_flags & __DTF_READALL)
_filldir(dirp, false);
else {
diff --git a/lib/libc/gen/scandir.3 b/lib/libc/gen/scandir.3
index eaba7547fed3..aa8dea030a75 100644
--- a/lib/libc/gen/scandir.3
+++ b/lib/libc/gen/scandir.3
@@ -92,7 +92,7 @@ by freeing each pointer in the array and then the array itself.
.Pp
The
.Fn scandir_b
-function behaves in the same way as
+function behaves in the same way as
.Fn scandir ,
but takes blocks as arguments instead of function pointers and calls
.Fn qsort_b
@@ -106,8 +106,8 @@ cannot allocate enough memory to hold all the data structures.
.Xr directory 3 ,
.Xr malloc 3 ,
.Xr qsort 3 ,
-.Xr dir 5 ,
-.Xr strcoll 3
+.Xr strcoll 3 ,
+.Xr dir 5
.Sh HISTORY
The
.Fn scandir
diff --git a/lib/libc/gen/sem_new.c b/lib/libc/gen/sem_new.c
index 3ee0272270fd..c5dc7e7415f3 100644
--- a/lib/libc/gen/sem_new.c
+++ b/lib/libc/gen/sem_new.c
@@ -439,8 +439,10 @@ _sem_post(sem_t *sem)
do {
count = sem->_kern._count;
- if (USEM_COUNT(count) + 1 > SEM_VALUE_MAX)
- return (EOVERFLOW);
+ if (USEM_COUNT(count) + 1 > SEM_VALUE_MAX) {
+ errno = EOVERFLOW;
+ return (-1);
+ }
} while (!atomic_cmpset_rel_int(&sem->_kern._count, count, count + 1));
if (count & USEM_HAS_WAITERS)
usem_wake(&sem->_kern);
diff --git a/lib/libc/gen/sem_post.3 b/lib/libc/gen/sem_post.3
index 485d2fcb54f8..dea8eb697169 100644
--- a/lib/libc/gen/sem_post.3
+++ b/lib/libc/gen/sem_post.3
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 15, 2000
+.Dd January 28, 2015
.Dt SEM_POST 3
.Os
.Sh NAME
@@ -65,6 +65,9 @@ The
.Fa sem
argument
points to an invalid semaphore.
+.It Bq Er EOVERFLOW
+The semaphore value would exceed
+.Dv SEM_VALUE_MAX .
.El
.Sh SEE ALSO
.Xr sem_getvalue 3 ,
diff --git a/lib/libc/gen/setmode.3 b/lib/libc/gen/setmode.3
index 5cab44a9326f..684c2e1d2bbf 100644
--- a/lib/libc/gen/setmode.3
+++ b/lib/libc/gen/setmode.3
@@ -28,7 +28,7 @@
.\" @(#)setmode.3 8.2 (Berkeley) 4/28/95
.\" $FreeBSD$
.\"
-.Dd April 28, 1995
+.Dd February 22, 2015
.Dt SETMODE 3
.Os
.Sh NAME
@@ -99,7 +99,20 @@ The
function
may fail and set errno for any of the errors specified for the library
routine
-.Xr malloc 3 .
+.Xr malloc 3
+or
+.Xr strtol 3 .
+In addition,
+.Fn setmode
+will fail and set
+.Va errno
+to:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+The
+.Fa mode
+argument does not represent a valid mode.
+.El
.Sh SEE ALSO
.Xr chmod 1 ,
.Xr stat 2 ,
diff --git a/lib/libc/gen/setmode.c b/lib/libc/gen/setmode.c
index 3966fd0e60a7..815cf146ed0b 100644
--- a/lib/libc/gen/setmode.c
+++ b/lib/libc/gen/setmode.c
@@ -39,8 +39,11 @@ __FBSDID("$FreeBSD$");
#include "namespace.h"
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/sysctl.h>
#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
#include <signal.h>
#include <stddef.h>
#include <stdlib.h>
@@ -66,7 +69,8 @@ typedef struct bitcmd {
#define CMD2_OBITS 0x08
#define CMD2_UBITS 0x10
-static BITCMD *addcmd(BITCMD *, int, int, int, u_int);
+static mode_t getumask(void);
+static BITCMD *addcmd(BITCMD *, mode_t, mode_t, mode_t, mode_t);
static void compress_mode(BITCMD *);
#ifdef SETMODE_DEBUG
static void dumpmode(BITCMD *);
@@ -151,45 +155,37 @@ common: if (set->cmd2 & CMD2_CLR) {
BITCMD *newset; \
setlen += SET_LEN_INCR; \
newset = realloc(saveset, sizeof(BITCMD) * setlen); \
- if (!newset) { \
- if (saveset) \
- free(saveset); \
- saveset = NULL; \
- return (NULL); \
- } \
+ if (newset == NULL) \
+ goto out; \
set = newset + (set - saveset); \
saveset = newset; \
endset = newset + (setlen - 2); \
} \
- set = addcmd(set, (a), (b), (c), (d))
+ set = addcmd(set, (mode_t)(a), (mode_t)(b), (mode_t)(c), (d))
#define STANDARD_BITS (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO)
void *
setmode(const char *p)
{
- int perm, who;
+ int serrno;
char op, *ep;
BITCMD *set, *saveset, *endset;
- sigset_t sigset, sigoset;
- mode_t mask;
- int equalopdone=0, permXbits, setlen;
+ mode_t mask, perm, permXbits, who;
long perml;
+ int equalopdone;
+ int setlen;
- if (!*p)
+ if (!*p) {
+ errno = EINVAL;
return (NULL);
+ }
/*
* Get a copy of the mask for the permissions that are mask relative.
- * Flip the bits, we want what's not set. Since it's possible that
- * the caller is opening files inside a signal handler, protect them
- * as best we can.
+ * Flip the bits, we want what's not set.
*/
- sigfillset(&sigset);
- (void)_sigprocmask(SIG_BLOCK, &sigset, &sigoset);
- (void)umask(mask = umask(0));
- mask = ~mask;
- (void)_sigprocmask(SIG_SETMASK, &sigoset, NULL);
+ mask = ~getumask();
setlen = SET_LEN + 2;
@@ -203,10 +199,17 @@ setmode(const char *p)
* or illegal bits.
*/
if (isdigit((unsigned char)*p)) {
+ errno = 0;
perml = strtol(p, &ep, 8);
- if (*ep || perml < 0 || perml & ~(STANDARD_BITS|S_ISTXT)) {
- free(saveset);
- return (NULL);
+ if (*ep) {
+ errno = EINVAL;
+ goto out;
+ }
+ if (errno == ERANGE && (perml == LONG_MAX || perml == LONG_MIN))
+ goto out;
+ if (perml & ~(STANDARD_BITS|S_ISTXT)) {
+ errno = EINVAL;
+ goto out;
}
perm = (mode_t)perml;
ADDCMD('=', (STANDARD_BITS|S_ISTXT), perm, mask);
@@ -218,6 +221,7 @@ setmode(const char *p)
* Build list of structures to set/clear/copy bits as described by
* each clause of the symbolic mode.
*/
+ equalopdone = 0;
for (;;) {
/* First, find out which bits might be modified. */
for (who = 0;; ++p) {
@@ -240,8 +244,8 @@ setmode(const char *p)
}
getop: if ((op = *p++) != '+' && op != '-' && op != '=') {
- free(saveset);
- return (NULL);
+ errno = EINVAL;
+ goto out;
}
if (op == '=')
equalopdone = 0;
@@ -330,10 +334,44 @@ apply: if (!*p)
dumpmode(saveset);
#endif
return (saveset);
+out:
+ serrno = errno;
+ free(saveset);
+ errno = serrno;
+ return NULL;
+}
+
+static mode_t
+getumask(void)
+{
+ sigset_t sigset, sigoset;
+ size_t len;
+ mode_t mask;
+ u_short smask;
+
+ /*
+ * First try requesting the umask without temporarily modifying it.
+ * Note that this does not work if the sysctl
+ * security.bsd.unprivileged_proc_debug is set to 0.
+ */
+ len = sizeof(smask);
+ if (sysctl((int[4]){ CTL_KERN, KERN_PROC, KERN_PROC_UMASK, getpid() },
+ 4, &smask, &len, NULL, 0) == 0)
+ return (smask);
+
+ /*
+ * Since it's possible that the caller is opening files inside a signal
+ * handler, protect them as best we can.
+ */
+ sigfillset(&sigset);
+ (void)_sigprocmask(SIG_BLOCK, &sigset, &sigoset);
+ (void)umask(mask = umask(0));
+ (void)_sigprocmask(SIG_SETMASK, &sigoset, NULL);
+ return (mask);
}
static BITCMD *
-addcmd(BITCMD *set, int op, int who, int oparg, u_int mask)
+addcmd(BITCMD *set, mode_t op, mode_t who, mode_t oparg, mode_t mask)
{
switch (op) {
case '=':
diff --git a/lib/libc/gen/setproctitle.c b/lib/libc/gen/setproctitle.c
index cd705fb60946..9dff3287102e 100644
--- a/lib/libc/gen/setproctitle.c
+++ b/lib/libc/gen/setproctitle.c
@@ -42,9 +42,10 @@ __FBSDID("$FreeBSD$");
* 1: old_ps_strings at the very top of the stack.
* 2: old_ps_strings at SPARE_USRSPACE below the top of the stack.
* 3: ps_strings at the very top of the stack.
- * This attempts to support a kernel built in the #2 and #3 era.
- */
-
+ * We only support a kernel providing #3 style ps_strings.
+ *
+ * For historical purposes, a definition of the old ps_strings structure
+ * and location is preserved below:
struct old_ps_strings {
char *old_ps_argvstr;
int old_ps_nargvstr;
@@ -53,6 +54,7 @@ struct old_ps_strings {
};
#define OLD_PS_STRINGS ((struct old_ps_strings *) \
(USRSTACK - SPARE_USRSPACE - sizeof(struct old_ps_strings)))
+ */
#include <stdarg.h>
@@ -136,41 +138,38 @@ setproctitle(const char *fmt, ...)
ps_strings = (struct ps_strings *)ul_ps_strings;
}
- /* PS_STRINGS points to zeroed memory on a style #2 kernel */
- if (ps_strings->ps_argvstr) {
- /* style #3 */
- if (oargc == -1) {
- /* Record our original args */
- oargc = ps_strings->ps_nargvstr;
- oargv = ps_strings->ps_argvstr;
- for (i = len = 0; i < oargc; i++) {
- /*
- * The program may have scribbled into its
- * argv array, e.g., to remove some arguments.
- * If that has happened, break out before
- * trying to call strlen on a NULL pointer.
- */
- if (oargv[i] == NULL) {
- oargc = i;
- break;
- }
- snprintf(obuf + len, SPT_BUFSIZE - len, "%s%s",
- len ? " " : "", oargv[i]);
- if (len)
- len++;
- len += strlen(oargv[i]);
- if (len >= SPT_BUFSIZE)
- break;
+ /*
+ * PS_STRINGS points to zeroed memory on a style #2 kernel.
+ * Should not happen.
+ */
+ if (ps_strings->ps_argvstr == NULL)
+ return;
+
+ /* style #3 */
+ if (oargc == -1) {
+ /* Record our original args */
+ oargc = ps_strings->ps_nargvstr;
+ oargv = ps_strings->ps_argvstr;
+ for (i = len = 0; i < oargc; i++) {
+ /*
+ * The program may have scribbled into its
+ * argv array, e.g., to remove some arguments.
+ * If that has happened, break out before
+ * trying to call strlen on a NULL pointer.
+ */
+ if (oargv[i] == NULL) {
+ oargc = i;
+ break;
}
+ snprintf(obuf + len, SPT_BUFSIZE - len, "%s%s",
+ len != 0 ? " " : "", oargv[i]);
+ if (len != 0)
+ len++;
+ len += strlen(oargv[i]);
+ if (len >= SPT_BUFSIZE)
+ break;
}
- ps_strings->ps_nargvstr = nargc;
- ps_strings->ps_argvstr = nargvp;
- } else {
- /* style #2 - we can only restore our first arg :-( */
- if (*obuf == '\0')
- strncpy(obuf, OLD_PS_STRINGS->old_ps_argvstr,
- SPT_BUFSIZE - 1);
- OLD_PS_STRINGS->old_ps_nargvstr = 1;
- OLD_PS_STRINGS->old_ps_argvstr = nargvp[0];
}
+ ps_strings->ps_nargvstr = nargc;
+ ps_strings->ps_argvstr = nargvp;
}
diff --git a/lib/libc/gen/sleep.3 b/lib/libc/gen/sleep.3
index ecfa237ad2ce..00e8f8d1daba 100644
--- a/lib/libc/gen/sleep.3
+++ b/lib/libc/gen/sleep.3
@@ -33,7 +33,7 @@
.Os
.Sh NAME
.Nm sleep
-.Nd suspend process execution for an interval measured in seconds
+.Nd suspend thread execution for an interval measured in seconds
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
@@ -43,11 +43,11 @@
.Sh DESCRIPTION
The
.Fn sleep
-function suspends execution of the calling process until either
+function suspends execution of the calling thread until either
.Fa seconds
-seconds have elapsed or a signal is delivered to the process and its
+seconds have elapsed or a signal is delivered to the thread and its
action is to invoke a signal-catching function or to terminate the
-process.
+thread or process.
System activity may lengthen the sleep by an indeterminate amount.
.Pp
This function is implemented using
diff --git a/lib/libc/gen/sleep.c b/lib/libc/gen/sleep.c
index b807c2d1d53e..6bb4ecd80838 100644
--- a/lib/libc/gen/sleep.c
+++ b/lib/libc/gen/sleep.c
@@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include "un-namespace.h"
+#include "libc_private.h"
+
unsigned int
__sleep(unsigned int seconds)
{
@@ -55,12 +57,14 @@ __sleep(unsigned int seconds)
time_to_sleep.tv_sec = seconds;
time_to_sleep.tv_nsec = 0;
- if (_nanosleep(&time_to_sleep, &time_remaining) != -1)
+ if (((int (*)(const struct timespec *, struct timespec *))
+ __libc_interposing[INTERPOS_nanosleep])(
+ &time_to_sleep, &time_remaining) != -1)
return (0);
if (errno != EINTR)
return (seconds); /* best guess */
return (time_remaining.tv_sec +
- (time_remaining.tv_nsec != 0)); /* round up */
+ (time_remaining.tv_nsec != 0)); /* round up */
}
__weak_reference(__sleep, sleep);
diff --git a/lib/libc/gen/stringlist.c b/lib/libc/gen/stringlist.c
index a09a8e705e36..236af17516d6 100644
--- a/lib/libc/gen/stringlist.c
+++ b/lib/libc/gen/stringlist.c
@@ -10,8 +10,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c
index 3a5cafec51c2..003f24ddcaf6 100644
--- a/lib/libc/gen/syslog.c
+++ b/lib/libc/gen/syslog.c
@@ -261,26 +261,45 @@ vsyslog(int pri, const char *fmt, va_list ap)
connectlog();
/*
- * If the send() failed, there are two likely scenarios:
+ * If the send() fails, there are two likely scenarios:
* 1) syslogd was restarted
* 2) /var/run/log is out of socket buffer space, which
* in most cases means local DoS.
- * We attempt to reconnect to /var/run/log[priv] to take care of
- * case #1 and keep send()ing data to cover case #2
- * to give syslogd a chance to empty its socket buffer.
+ * If the error does not indicate a full buffer, we address
+ * case #1 by attempting to reconnect to /var/run/log[priv]
+ * and resending the message once.
*
- * If we are working with a priveleged socket, then take
- * only one attempt, because we don't want to freeze a
+ * If we are working with a privileged socket, the retry
+ * attempts end there, because we don't want to freeze a
* critical application like su(1) or sshd(8).
*
+ * Otherwise, we address case #2 by repeatedly retrying the
+ * send() to give syslogd a chance to empty its socket buffer.
*/
if (send(LogFile, tbuf, cnt, 0) < 0) {
if (errno != ENOBUFS) {
+ /*
+ * Scenario 1: syslogd was restarted
+ * reconnect and resend once
+ */
disconnectlog();
connectlog();
+ if (send(LogFile, tbuf, cnt, 0) >= 0) {
+ THREAD_UNLOCK();
+ return;
+ }
+ /*
+ * if the resend failed, fall through to
+ * possible scenario 2
+ */
}
- do {
+ while (errno == ENOBUFS) {
+ /*
+ * Scenario 2: out of socket buffer space
+ * possible DoS, fail fast on a privileged
+ * socket
+ */
if (status == CONNPRIV)
break;
_usleep(1);
@@ -288,7 +307,7 @@ vsyslog(int pri, const char *fmt, va_list ap)
THREAD_UNLOCK();
return;
}
- } while (errno == ENOBUFS);
+ }
} else {
THREAD_UNLOCK();
return;
@@ -350,7 +369,7 @@ connectlog(void)
SyslogAddr.sun_family = AF_UNIX;
/*
- * First try priveleged socket. If no success,
+ * First try privileged socket. If no success,
* then try default socket.
*/
(void)strncpy(SyslogAddr.sun_path, _PATH_LOG_PRIV,
diff --git a/lib/libc/gen/telldir.c b/lib/libc/gen/telldir.c
index d72b500b051c..19cd6ee9fec8 100644
--- a/lib/libc/gen/telldir.c
+++ b/lib/libc/gen/telldir.c
@@ -101,9 +101,22 @@ _seekdir(dirp, loc)
return;
if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek)
return;
+
+ /* If it's within the same chunk of data, don't bother reloading. */
+ if (lp->loc_seek == dirp->dd_seek) {
+ /*
+ * If we go back to 0 don't make the next readdir
+ * trigger a call to getdirentries().
+ */
+ if (lp->loc_loc == 0)
+ dirp->dd_flags |= __DTF_SKIPREAD;
+ dirp->dd_loc = lp->loc_loc;
+ return;
+ }
(void) lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET);
dirp->dd_seek = lp->loc_seek;
dirp->dd_loc = 0;
+ dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */
while (dirp->dd_loc < lp->loc_loc) {
dp = _readdir_unlocked(dirp, 0);
if (dp == NULL)
@@ -112,6 +125,30 @@ _seekdir(dirp, loc)
}
/*
+ * After readdir returns the last entry in a block, a call to telldir
+ * returns a location that is after the end of that last entry.
+ * However, that location doesn't refer to a valid directory entry.
+ * Ideally, the call to telldir would return a location that refers to
+ * the first entry in the next block. That location is not known
+ * until the next block is read, so readdir calls this function after
+ * fetching a new block to fix any such telldir locations.
+ */
+void
+_fixtelldir(DIR *dirp, long oldseek, long oldloc)
+{
+ struct ddloc *lp;
+
+ lp = LIST_FIRST(&dirp->dd_td->td_locq);
+ if (lp != NULL) {
+ if (lp->loc_loc == oldloc &&
+ lp->loc_seek == oldseek) {
+ lp->loc_seek = dirp->dd_seek;
+ lp->loc_loc = dirp->dd_loc;
+ }
+ }
+}
+
+/*
* Reclaim memory for telldir cookies which weren't used.
*/
void
diff --git a/lib/libc/gen/telldir.h b/lib/libc/gen/telldir.h
index 04989bb7b536..bccabb1aea53 100644
--- a/lib/libc/gen/telldir.h
+++ b/lib/libc/gen/telldir.h
@@ -64,5 +64,6 @@ bool _filldir(DIR *, bool);
struct dirent *_readdir_unlocked(DIR *, int);
void _reclaim_telldir(DIR *);
void _seekdir(DIR *, long);
+void _fixtelldir(DIR *dirp, long oldseek, long oldloc);
#endif
diff --git a/lib/libc/gen/termios.c b/lib/libc/gen/termios.c
index 7e9f1691876f..f8b7354f3162 100644
--- a/lib/libc/gen/termios.c
+++ b/lib/libc/gen/termios.c
@@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include "un-namespace.h"
+#include "libc_private.h"
+
int
tcgetattr(int fd, struct termios *t)
{
@@ -208,13 +210,23 @@ tcsendbreak(int fd, int len __unused)
}
int
-__tcdrain(int fd)
+__libc_tcdrain(int fd)
{
+
return (_ioctl(fd, TIOCDRAIN, 0));
}
-__weak_reference(__tcdrain, tcdrain);
-__weak_reference(__tcdrain, _tcdrain);
+#pragma weak tcdrain
+int
+tcdrain(int fd)
+{
+
+ return (((int (*)(int))
+ __libc_interposing[INTERPOS_tcdrain])(fd));
+}
+
+__weak_reference(__libc_tcdrain, __tcdrain);
+__weak_reference(__libc_tcdrain, _tcdrain);
int
tcflush(int fd, int which)
diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c
index 5219418fdc32..58ebb55c0028 100644
--- a/lib/libc/gen/tls.c
+++ b/lib/libc/gen/tls.c
@@ -65,13 +65,14 @@ void __libc_free_tls(void *tls, size_t tcbsize, size_t tcbalign);
#if defined(__amd64__)
#define TLS_TCB_ALIGN 16
#elif defined(__powerpc__) || defined(__i386__) || defined(__arm__) || \
- defined(__sparc64__) || defined(__mips__)
+ defined(__sparc64__) || defined(__mips__) || defined(__aarch64__)
#define TLS_TCB_ALIGN sizeof(void *)
#else
#error TLS_TCB_ALIGN undefined for target architecture
#endif
-#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)
+#if defined(__arm__) || defined(__mips__) || defined(__powerpc__) || \
+ defined(__aarch64__)
#define TLS_VARIANT_I
#endif
#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__)
diff --git a/lib/libc/arm/gen/getcontextx.c b/lib/libc/gen/trivial-getcontextx.c
index 54f851384811..54f851384811 100644
--- a/lib/libc/arm/gen/getcontextx.c
+++ b/lib/libc/gen/trivial-getcontextx.c
diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c
index a21b77f9806e..02aa1587e14d 100644
--- a/lib/libc/gen/ttyname.c
+++ b/lib/libc/gen/ttyname.c
@@ -65,7 +65,7 @@ ttyname_r(int fd, char *buf, size_t len)
/* Must be a terminal. */
if (!isatty(fd))
- return (ENOTTY);
+ return (errno);
/* Must have enough room */
if (len <= sizeof(_PATH_DEV))
return (ERANGE);
@@ -73,7 +73,7 @@ ttyname_r(int fd, char *buf, size_t len)
strcpy(buf, _PATH_DEV);
used = strlen(buf);
if (fdevname_r(fd, buf + used, len - used) == NULL)
- return (ENOTTY);
+ return (errno == EINVAL ? ERANGE : errno);
return (0);
}
diff --git a/lib/libc/gen/ulimit.c b/lib/libc/gen/ulimit.c
index e1bc02066209..2c090c0a7ef3 100644
--- a/lib/libc/gen/ulimit.c
+++ b/lib/libc/gen/ulimit.c
@@ -40,7 +40,7 @@ ulimit(int cmd, ...)
{
struct rlimit limit;
va_list ap;
- long arg;
+ rlim_t arg;
if (cmd == UL_GETFSIZE) {
if (getrlimit(RLIMIT_FSIZE, &limit) == -1)
@@ -53,14 +53,16 @@ ulimit(int cmd, ...)
va_start(ap, cmd);
arg = va_arg(ap, long);
va_end(ap);
- limit.rlim_max = limit.rlim_cur = (rlim_t)arg * 512;
+ if (arg < 0)
+ arg = LONG_MAX;
+ if (arg > RLIM_INFINITY / 512)
+ arg = RLIM_INFINITY / 512;
+ limit.rlim_max = limit.rlim_cur = arg * 512;
/* The setrlimit() function sets errno to EPERM if needed. */
if (setrlimit(RLIMIT_FSIZE, &limit) == -1)
return (-1);
- if (arg * 512 > LONG_MAX)
- return (LONG_MAX);
- return (arg);
+ return ((long)arg);
} else {
errno = EINVAL;
return (-1);
diff --git a/lib/libc/gen/usleep.c b/lib/libc/gen/usleep.c
index 7d6559be22a3..7c35f6c6fd9c 100644
--- a/lib/libc/gen/usleep.c
+++ b/lib/libc/gen/usleep.c
@@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include "un-namespace.h"
+#include "libc_private.h"
+
int
__usleep(useconds_t useconds)
{
@@ -45,7 +47,8 @@ __usleep(useconds_t useconds)
time_to_sleep.tv_nsec = (useconds % 1000000) * 1000;
time_to_sleep.tv_sec = useconds / 1000000;
- return (_nanosleep(&time_to_sleep, NULL));
+ return (((int (*)(const struct timespec *, struct timespec *))
+ __libc_interposing[INTERPOS_nanosleep])(&time_to_sleep, NULL));
}
__weak_reference(__usleep, usleep);
diff --git a/lib/libc/gen/wait.c b/lib/libc/gen/wait.c
index 2169b9d105c4..46a3fdd0bf52 100644
--- a/lib/libc/gen/wait.c
+++ b/lib/libc/gen/wait.c
@@ -40,10 +40,14 @@ __FBSDID("$FreeBSD$");
#include <sys/resource.h>
#include "un-namespace.h"
+#include "libc_private.h"
+
pid_t
__wait(int *istat)
{
- return (_wait4(WAIT_ANY, istat, 0, (struct rusage *)0));
+
+ return (((pid_t (*)(pid_t, int *, int, struct rusage *))
+ __libc_interposing[INTERPOS_wait4])(WAIT_ANY, istat, 0, NULL));
}
__weak_reference(__wait, wait);
diff --git a/lib/libc/gen/wait3.c b/lib/libc/gen/wait3.c
index 609877332659..965effe43262 100644
--- a/lib/libc/gen/wait3.c
+++ b/lib/libc/gen/wait3.c
@@ -40,11 +40,14 @@ __FBSDID("$FreeBSD$");
#include <sys/resource.h>
#include "un-namespace.h"
+#include "libc_private.h"
+
pid_t
-wait3(istat, options, rup)
- int *istat;
- int options;
- struct rusage *rup;
+__wait3(int *istat, int options, struct rusage *rup)
{
- return (_wait4(WAIT_ANY, istat, options, rup));
+
+ return (((pid_t (*)(pid_t, int *, int, struct rusage *))
+ __libc_interposing[INTERPOS_wait4])(WAIT_ANY, istat, options, rup));
}
+
+__weak_reference(__wait3, wait3);
diff --git a/lib/libc/gen/waitid.c b/lib/libc/gen/waitid.c
index 795b2085f8d5..17a2dd6920b6 100644
--- a/lib/libc/gen/waitid.c
+++ b/lib/libc/gen/waitid.c
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
#include <signal.h>
#include <errno.h>
#include "un-namespace.h"
+#include "libc_private.h"
int
__waitid(idtype_t idtype, id_t id, siginfo_t *info, int flags)
@@ -44,7 +45,9 @@ __waitid(idtype_t idtype, id_t id, siginfo_t *info, int flags)
int status;
pid_t ret;
- ret = _wait6(idtype, id, &status, flags, NULL, info);
+ ret = ((pid_t (*)(idtype_t, id_t, int *, int, struct __wrusage *,
+ siginfo_t *))__libc_interposing[INTERPOS_wait6])(idtype, id,
+ &status, flags, NULL, info);
/*
* According to SUSv4, waitid() shall not return a PID when a
diff --git a/lib/libc/gen/waitpid.c b/lib/libc/gen/waitpid.c
index b00183746b8a..5177591a67cb 100644
--- a/lib/libc/gen/waitpid.c
+++ b/lib/libc/gen/waitpid.c
@@ -40,10 +40,14 @@ __FBSDID("$FreeBSD$");
#include <sys/resource.h>
#include "un-namespace.h"
+#include "libc_private.h"
+
pid_t
__waitpid(pid_t pid, int *istat, int options)
{
- return (_wait4(pid, istat, options, (struct rusage *)0));
+
+ return (((pid_t (*)(pid_t, int *, int, struct rusage *))
+ __libc_interposing[INTERPOS_wait4])(pid, istat, options, NULL));
}
__weak_reference(__waitpid, waitpid);
diff --git a/lib/libc/gen/wordexp.c b/lib/libc/gen/wordexp.c
index 377caff51cc5..c7f4b1d0e902 100644
--- a/lib/libc/gen/wordexp.c
+++ b/lib/libc/gen/wordexp.c
@@ -118,8 +118,10 @@ we_askshell(const char *words, wordexp_t *we, int flags)
char *nstrings; /* Temporary for realloc() */
char **nwv; /* Temporary for realloc() */
sigset_t newsigblock, oldsigblock;
+ const char *ifs;
serrno = errno;
+ ifs = getenv("IFS");
if (pipe2(pdes, O_CLOEXEC) < 0)
return (WRDE_NOSPACE); /* XXX */
@@ -145,7 +147,8 @@ we_askshell(const char *words, wordexp_t *we, int flags)
_fcntl(pdes[1], F_SETFD, 0)) < 0)
_exit(1);
execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u",
- "-c", "eval \"$1\";eval \"wordexp $2\"", "",
+ "-c", "IFS=$1;eval \"$2\";eval \"wordexp $3\"", "",
+ ifs != NULL ? ifs : " \t\n",
flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null", words,
(char *)NULL);
_exit(1);
diff --git a/lib/libc/i386/sys/Makefile.inc b/lib/libc/i386/sys/Makefile.inc
index b56183c8e3ff..ebaa4620152a 100644
--- a/lib/libc/i386/sys/Makefile.inc
+++ b/lib/libc/i386/sys/Makefile.inc
@@ -15,9 +15,6 @@ MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
PSEUDO= _getlogin.o _exit.o
-.if ${MK_SYSCALL_COMPAT} != "no"
-PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
-.endif
MAN+= i386_get_ioperm.2 i386_get_ldt.2 i386_vm86.2
MAN+= i386_set_watch.3
diff --git a/lib/libc/iconv/__iconv.c b/lib/libc/iconv/__iconv.c
index c9bee3fee256..85170b74540a 100644
--- a/lib/libc/iconv/__iconv.c
+++ b/lib/libc/iconv/__iconv.c
@@ -31,7 +31,7 @@
#include "iconv-internal.h"
size_t
-__iconv(iconv_t a, const char **b, size_t *c, char **d,
+__iconv(iconv_t a, char **b, size_t *c, char **d,
size_t *e, __uint32_t f, size_t *g)
{
return __bsd___iconv(a, b, c, d, e, f, g);
diff --git a/lib/libc/iconv/bsd_iconv.c b/lib/libc/iconv/bsd_iconv.c
index f764886d7851..e032a5b1e0b2 100644
--- a/lib/libc/iconv/bsd_iconv.c
+++ b/lib/libc/iconv/bsd_iconv.c
@@ -120,7 +120,7 @@ __bsd_iconv_close(iconv_t handle)
}
size_t
-__bsd_iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *szout)
+__bsd_iconv(iconv_t handle, char **in, size_t *szin, char **out, size_t *szout)
{
size_t ret;
int err;
@@ -141,7 +141,7 @@ __bsd_iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *s
}
size_t
-__bsd___iconv(iconv_t handle, const char **in, size_t *szin, char **out,
+__bsd___iconv(iconv_t handle, char **in, size_t *szin, char **out,
size_t *szout, uint32_t flags, size_t *invalids)
{
size_t ret;
diff --git a/lib/libc/iconv/citrus_iconv.c b/lib/libc/iconv/citrus_iconv.c
index 5c8bf4923668..59940631f53b 100644
--- a/lib/libc/iconv/citrus_iconv.c
+++ b/lib/libc/iconv/citrus_iconv.c
@@ -278,7 +278,9 @@ _citrus_iconv_open(struct _citrus_iconv * __restrict * __restrict rcv,
struct _citrus_iconv *cv = NULL;
struct _citrus_iconv_shared *ci = NULL;
char realdst[PATH_MAX], realsrc[PATH_MAX];
+#ifdef _PATH_ICONV
char buf[PATH_MAX], path[PATH_MAX];
+#endif
int ret;
init_cache();
@@ -290,10 +292,16 @@ _citrus_iconv_open(struct _citrus_iconv * __restrict * __restrict rcv,
dst = nl_langinfo(CODESET);
/* resolve codeset name aliases */
+#ifdef _PATH_ICONV
+ snprintf(path, sizeof(path), "%s/%s", _PATH_ICONV, _CITRUS_ICONV_ALIAS);
strlcpy(realsrc, _lookup_alias(path, src, buf, (size_t)PATH_MAX,
_LOOKUP_CASE_IGNORE), (size_t)PATH_MAX);
strlcpy(realdst, _lookup_alias(path, dst, buf, (size_t)PATH_MAX,
_LOOKUP_CASE_IGNORE), (size_t)PATH_MAX);
+#else
+ strlcpy(realsrc, src, (size_t)PATH_MAX);
+ strlcpy(realdst, dst, (size_t)PATH_MAX);
+#endif
/* sanity check */
if (strchr(realsrc, '/') != NULL || strchr(realdst, '/'))
diff --git a/lib/libc/iconv/citrus_iconv.h b/lib/libc/iconv/citrus_iconv.h
index ac14ac318ac5..99604e92063d 100644
--- a/lib/libc/iconv/citrus_iconv.h
+++ b/lib/libc/iconv/citrus_iconv.h
@@ -52,7 +52,7 @@ __END_DECLS
*/
static __inline int
_citrus_iconv_convert(struct _citrus_iconv * __restrict cv,
- const char * __restrict * __restrict in, size_t * __restrict inbytes,
+ char * __restrict * __restrict in, size_t * __restrict inbytes,
char * __restrict * __restrict out, size_t * __restrict outbytes,
uint32_t flags, size_t * __restrict nresults)
{
diff --git a/lib/libc/iconv/citrus_iconv_local.h b/lib/libc/iconv/citrus_iconv_local.h
index 12d2fa33fa73..5392da1ddf20 100644
--- a/lib/libc/iconv/citrus_iconv_local.h
+++ b/lib/libc/iconv/citrus_iconv_local.h
@@ -46,7 +46,7 @@ static void _citrus_##_m_##_iconv_uninit_shared \
(struct _citrus_iconv_shared *); \
static int _citrus_##_m_##_iconv_convert \
(struct _citrus_iconv * __restrict, \
- const char * __restrict * __restrict, \
+ char * __restrict * __restrict, \
size_t * __restrict, \
char * __restrict * __restrict, \
size_t * __restrict outbytes, \
@@ -75,7 +75,7 @@ typedef void (*_citrus_iconv_uninit_shared_t)
(struct _citrus_iconv_shared *);
typedef int (*_citrus_iconv_convert_t)
(struct _citrus_iconv * __restrict,
- const char *__restrict* __restrict, size_t * __restrict,
+ char *__restrict* __restrict, size_t * __restrict,
char * __restrict * __restrict, size_t * __restrict, uint32_t,
size_t * __restrict);
typedef int (*_citrus_iconv_init_context_t)(struct _citrus_iconv *);
diff --git a/lib/libc/iconv/citrus_none.c b/lib/libc/iconv/citrus_none.c
index 4f9b254fc133..9ec4bd360cb8 100644
--- a/lib/libc/iconv/citrus_none.c
+++ b/lib/libc/iconv/citrus_none.c
@@ -83,7 +83,7 @@ _citrus_NONE_stdenc_init_state(struct _citrus_stdenc * __restrict ce __unused,
static int
_citrus_NONE_stdenc_mbtocs(struct _citrus_stdenc * __restrict ce __unused,
- _csid_t *csid, _index_t *idx, const char **s, size_t n,
+ _csid_t *csid, _index_t *idx, char **s, size_t n,
void *ps __unused, size_t *nresult, struct iconv_hooks *hooks)
{
@@ -159,7 +159,7 @@ _citrus_NONE_stdenc_cstomb(struct _citrus_stdenc * __restrict ce __unused,
static int
_citrus_NONE_stdenc_mbtowc(struct _citrus_stdenc * __restrict ce __unused,
- _wc_t * __restrict pwc, const char ** __restrict s, size_t n,
+ _wc_t * __restrict pwc, char ** __restrict s, size_t n,
void * __restrict pspriv __unused, size_t * __restrict nresult,
struct iconv_hooks *hooks)
{
diff --git a/lib/libc/iconv/citrus_prop.c b/lib/libc/iconv/citrus_prop.c
index 28318de05a35..642e4230986a 100644
--- a/lib/libc/iconv/citrus_prop.c
+++ b/lib/libc/iconv/citrus_prop.c
@@ -293,8 +293,10 @@ done:
}
_memstream_ungetc(ms, ch);
errnum = _citrus_prop_read_character_common(ms, &ch);
- if (errnum != 0)
+ if (errnum != 0) {
+ free(s);
return (errnum);
+ }
s[n] = ch;
++n, --m;
}
diff --git a/lib/libc/iconv/citrus_stdenc.h b/lib/libc/iconv/citrus_stdenc.h
index 28fa29d8cc94..50f4dffa4e16 100644
--- a/lib/libc/iconv/citrus_stdenc.h
+++ b/lib/libc/iconv/citrus_stdenc.h
@@ -69,7 +69,7 @@ _citrus_stdenc_init_state(struct _citrus_stdenc * __restrict ce,
static __inline int
_citrus_stdenc_mbtocs(struct _citrus_stdenc * __restrict ce,
_citrus_csid_t * __restrict csid, _citrus_index_t * __restrict idx,
- const char ** __restrict s, size_t n, void * __restrict ps,
+ char ** __restrict s, size_t n, void * __restrict ps,
size_t * __restrict nresult, struct iconv_hooks *hooks)
{
diff --git a/lib/libc/iconv/citrus_stdenc_local.h b/lib/libc/iconv/citrus_stdenc_local.h
index 7b627a05fd19..141abffea9b9 100644
--- a/lib/libc/iconv/citrus_stdenc_local.h
+++ b/lib/libc/iconv/citrus_stdenc_local.h
@@ -55,7 +55,7 @@ static int _citrus_##_e_##_stdenc_mbtocs \
(struct _citrus_stdenc * __restrict, \
_citrus_csid_t * __restrict, \
_citrus_index_t * __restrict, \
- const char ** __restrict, size_t, \
+ char ** __restrict, size_t, \
void * __restrict, size_t * __restrict, \
struct iconv_hooks *); \
static int _citrus_##_e_##_stdenc_cstomb \
@@ -66,7 +66,7 @@ static int _citrus_##_e_##_stdenc_cstomb \
static int _citrus_##_e_##_stdenc_mbtowc \
(struct _citrus_stdenc * __restrict, \
_citrus_wc_t * __restrict, \
- const char ** __restrict, size_t, \
+ char ** __restrict, size_t, \
void * __restrict, size_t * __restrict, \
struct iconv_hooks *); \
static int _citrus_##_e_##_stdenc_wctomb \
@@ -106,7 +106,7 @@ typedef int (*_citrus_stdenc_init_state_t)
typedef int (*_citrus_stdenc_mbtocs_t)
(struct _citrus_stdenc * __restrict,
_citrus_csid_t * __restrict, _citrus_index_t * __restrict,
- const char ** __restrict, size_t,
+ char ** __restrict, size_t,
void * __restrict, size_t * __restrict,
struct iconv_hooks *);
typedef int (*_citrus_stdenc_cstomb_t)
@@ -116,7 +116,7 @@ typedef int (*_citrus_stdenc_cstomb_t)
typedef int (*_citrus_stdenc_mbtowc_t)
(struct _citrus_stdenc * __restrict,
_citrus_wc_t * __restrict,
- const char ** __restrict, size_t,
+ char ** __restrict, size_t,
void * __restrict, size_t * __restrict,
struct iconv_hooks *);
typedef int (*_citrus_stdenc_wctomb_t)
diff --git a/lib/libc/iconv/citrus_stdenc_template.h b/lib/libc/iconv/citrus_stdenc_template.h
index 21bc5cc95cd9..9a05fa789fa6 100644
--- a/lib/libc/iconv/citrus_stdenc_template.h
+++ b/lib/libc/iconv/citrus_stdenc_template.h
@@ -112,7 +112,7 @@ _FUNCNAME(stdenc_init_state)(struct _citrus_stdenc * __restrict ce,
static int
_FUNCNAME(stdenc_mbtocs)(struct _citrus_stdenc * __restrict ce,
_citrus_csid_t * __restrict csid, _citrus_index_t * __restrict idx,
- const char ** __restrict s, size_t n, void * __restrict ps,
+ char ** __restrict s, size_t n, void * __restrict ps,
size_t * __restrict nresult, struct iconv_hooks *hooks)
{
wchar_t wc;
@@ -151,7 +151,7 @@ _FUNCNAME(stdenc_cstomb)(struct _citrus_stdenc * __restrict ce,
static int
_FUNCNAME(stdenc_mbtowc)(struct _citrus_stdenc * __restrict ce,
- _citrus_wc_t * __restrict wc, const char ** __restrict s, size_t n,
+ _citrus_wc_t * __restrict wc, char ** __restrict s, size_t n,
void * __restrict ps, size_t * __restrict nresult,
struct iconv_hooks *hooks)
{
diff --git a/lib/libc/iconv/iconv-internal.h b/lib/libc/iconv/iconv-internal.h
index 9a6b3d91367b..9937f09f78f1 100644
--- a/lib/libc/iconv/iconv-internal.h
+++ b/lib/libc/iconv/iconv-internal.h
@@ -29,11 +29,11 @@
/*
* Interal prototypes for our back-end functions.
*/
-size_t __bsd___iconv(iconv_t, const char **, size_t *, char **,
+size_t __bsd___iconv(iconv_t, char **, size_t *, char **,
size_t *, __uint32_t, size_t *);
void __bsd___iconv_free_list(char **, size_t);
int __bsd___iconv_get_list(char ***, size_t *, __iconv_bool);
-size_t __bsd_iconv(iconv_t, const char ** __restrict,
+size_t __bsd_iconv(iconv_t, char ** __restrict,
size_t * __restrict, char ** __restrict,
size_t * __restrict);
const char *__bsd_iconv_canonicalize(const char *);
diff --git a/lib/libc/iconv/iconv.3 b/lib/libc/iconv/iconv.3
index 6692c47d4f7d..1a4f8c3cfd75 100644
--- a/lib/libc/iconv/iconv.3
+++ b/lib/libc/iconv/iconv.3
@@ -48,7 +48,7 @@
.Ft size_t
.Fn iconv "iconv_t cd" "char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft"
.Ft size_t
-.Fn __iconv "iconv_t cd" "const char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" "uint32_t flags" "size_t invalids"
+.Fn __iconv "iconv_t cd" "char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" "uint32_t flags" "size_t * invalids"
.Sh DESCRIPTION
The
.Fn iconv_open
@@ -176,8 +176,8 @@ may be
.Dv NULL .
In this case, the shift sequence for the destination switching
to the initial state is discarded.
-.Pp
.El
+.Pp
The
.Fn __iconv
function works just like
diff --git a/lib/libc/iconv/iconv.c b/lib/libc/iconv/iconv.c
index d13c1dfa3375..4bd962009e65 100644
--- a/lib/libc/iconv/iconv.c
+++ b/lib/libc/iconv/iconv.c
@@ -31,7 +31,7 @@
#include "iconv-internal.h"
size_t
-iconv(iconv_t a, const char ** __restrict b,
+iconv(iconv_t a, char ** __restrict b,
size_t * __restrict c, char ** __restrict d,
size_t * __restrict e)
{
diff --git a/lib/libc/iconv/iconv_compat.c b/lib/libc/iconv/iconv_compat.c
index dea968f65f72..ded249956db9 100644
--- a/lib/libc/iconv/iconv_compat.c
+++ b/lib/libc/iconv/iconv_compat.c
@@ -37,7 +37,7 @@
#include "iconv-internal.h"
size_t
-__iconv_compat(iconv_t a, const char ** b, size_t * c, char ** d,
+__iconv_compat(iconv_t a, char ** b, size_t * c, char ** d,
size_t * e, __uint32_t f, size_t *g)
{
return __bsd___iconv(a, b, c, d, e, f, g);
@@ -56,7 +56,7 @@ __iconv_get_list_compat(char ***a, size_t *b, __iconv_bool c)
}
size_t
-iconv_compat(iconv_t a, const char ** __restrict b,
+iconv_compat(iconv_t a, char ** __restrict b,
size_t * __restrict c, char ** __restrict d,
size_t * __restrict e)
{
diff --git a/lib/libc/iconv/iconvlist.3 b/lib/libc/iconv/iconvlist.3
index bef609b31362..b1a6e0564341 100644
--- a/lib/libc/iconv/iconvlist.3
+++ b/lib/libc/iconv/iconvlist.3
@@ -78,9 +78,9 @@ If an error occurs,
will be NULL when calling
.Fn do_one .
.Sh SEE ALSO
-.Xr iconv 3 ,
+.Xr __iconv_free_list 3 ,
.Xr __iconv_get_list 3 ,
-.Xr __iconv_free_list 3
+.Xr iconv 3
.Sh STANDARDS
The
.Nm
diff --git a/lib/libc/include/compat.h b/lib/libc/include/compat.h
index 769454002788..b20fac5ac600 100644
--- a/lib/libc/include/compat.h
+++ b/lib/libc/include/compat.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2009 Advanced Computing Technologies LLC
+ * Copyright (c) 2009 Hudson River Trading LLC
* Written by: John H. Baldwin <jhb@FreeBSD.org>
* All rights reserved.
*
@@ -44,5 +44,12 @@ __sym_compat(shmctl, freebsd7_shmctl, FBSD_1.0);
#undef __sym_compat
+#define __weak_reference(sym,alias) \
+ .weak alias;.equ alias,sym
+
+__weak_reference(__sys_fcntl,__fcntl_compat)
+
+#undef __weak_reference
+
#endif /* __LIBC_COMPAT_H__ */
diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h
index 40a5f7266709..a670d63e0854 100644
--- a/lib/libc/include/libc_private.h
+++ b/lib/libc/include/libc_private.h
@@ -95,6 +95,9 @@ do { \
_SPINUNLOCK(&__stdio_thread_lock); \
} while (0)
+void __libc_spinlock_stub(struct _spinlock *);
+void __libc_spinunlock_stub(struct _spinlock *);
+
/*
* Indexes into the pthread jump table.
*
@@ -173,6 +176,57 @@ typedef pthread_func_t pthread_func_entry_t[2];
extern pthread_func_entry_t __thr_jtable[];
+void __set_error_selector(int *(*arg)(void));
+int _pthread_mutex_init_calloc_cb_stub(pthread_mutex_t *mutex,
+ void *(calloc_cb)(__size_t, __size_t));
+
+typedef int (*interpos_func_t)(void);
+interpos_func_t *__libc_interposing_slot(int interposno);
+extern interpos_func_t __libc_interposing[] __hidden;
+
+enum {
+ INTERPOS_accept,
+ INTERPOS_accept4,
+ INTERPOS_aio_suspend,
+ INTERPOS_close,
+ INTERPOS_connect,
+ INTERPOS_fcntl,
+ INTERPOS_fsync,
+ INTERPOS_fork,
+ INTERPOS_msync,
+ INTERPOS_nanosleep,
+ INTERPOS_openat,
+ INTERPOS_poll,
+ INTERPOS_pselect,
+ INTERPOS_recvfrom,
+ INTERPOS_recvmsg,
+ INTERPOS_select,
+ INTERPOS_sendmsg,
+ INTERPOS_sendto,
+ INTERPOS_setcontext,
+ INTERPOS_sigaction,
+ INTERPOS_sigprocmask,
+ INTERPOS_sigsuspend,
+ INTERPOS_sigwait,
+ INTERPOS_sigtimedwait,
+ INTERPOS_sigwaitinfo,
+ INTERPOS_swapcontext,
+ INTERPOS_system,
+ INTERPOS_tcdrain,
+ INTERPOS_read,
+ INTERPOS_readv,
+ INTERPOS_wait4,
+ INTERPOS_write,
+ INTERPOS_writev,
+ INTERPOS__pthread_mutex_init_calloc_cb,
+ INTERPOS_spinlock,
+ INTERPOS_spinunlock,
+ INTERPOS_kevent,
+ INTERPOS_wait6,
+ INTERPOS_ppoll,
+ INTERPOS_MAX
+};
+
/*
* yplib internal interfaces
*/
@@ -215,6 +269,8 @@ void _malloc_thread_cleanup(void);
void _malloc_prefork(void);
void _malloc_postfork(void);
+void _malloc_first_thread(void);
+
/*
* Function to clean up streams, called from abort() and exit().
*/
@@ -222,35 +278,96 @@ extern void (*__cleanup)(void) __hidden;
/*
* Get kern.osreldate to detect ABI revisions. Explicitly
- * ignores value of $OSVERSION and caches result. Prototypes
- * for the wrapped "new" pad-less syscalls are here for now.
+ * ignores value of $OSVERSION and caches result.
*/
-extern int __getosreldate(void);
+int __getosreldate(void);
#include <sys/_types.h>
-/* Without pad */
-extern __off_t __sys_lseek(int, __off_t, int);
-extern int __sys_ftruncate(int, __off_t);
-extern int __sys_truncate(const char *, __off_t);
-extern __ssize_t __sys_pread(int, void *, __size_t, __off_t);
-extern __ssize_t __sys_pwrite(int, const void *, __size_t, __off_t);
-extern void * __sys_mmap(void *, __size_t, int, int, int, __off_t);
-
-/* With pad */
-extern __off_t __sys_freebsd6_lseek(int, int, __off_t, int);
-extern int __sys_freebsd6_ftruncate(int, int, __off_t);
-extern int __sys_freebsd6_truncate(const char *, int, __off_t);
-extern __ssize_t __sys_freebsd6_pread(int, void *, __size_t, int, __off_t);
-extern __ssize_t __sys_freebsd6_pwrite(int, const void *, __size_t, int, __off_t);
-extern void * __sys_freebsd6_mmap(void *, __size_t, int, int, int, int, __off_t);
-
-/* Without back-compat translation */
-extern int __sys_fcntl(int, int, ...);
+#include <sys/_sigset.h>
+struct aiocb;
+struct fd_set;
+struct iovec;
+struct kevent;
+struct msghdr;
+struct pollfd;
+struct rusage;
+struct sigaction;
+struct sockaddr;
struct timespec;
struct timeval;
struct timezone;
-int __sys_gettimeofday(struct timeval *, struct timezone *);
-int __sys_clock_gettime(__clockid_t, struct timespec *ts);
+struct __siginfo;
+struct __ucontext;
+struct __wrusage;
+enum idtype;
+int __sys_aio_suspend(const struct aiocb * const[], int,
+ const struct timespec *);
+int __sys_accept(int, struct sockaddr *, __socklen_t *);
+int __sys_accept4(int, struct sockaddr *, __socklen_t *, int);
+int __sys_clock_gettime(__clockid_t, struct timespec *ts);
+int __sys_close(int);
+int __sys_connect(int, const struct sockaddr *, __socklen_t);
+int __sys_fcntl(int, int, ...);
+int __sys_fsync(int);
+__pid_t __sys_fork(void);
+int __sys_ftruncate(int, __off_t);
+int __sys_gettimeofday(struct timeval *, struct timezone *);
+int __sys_kevent(int, const struct kevent *, int, struct kevent *,
+ int, const struct timespec *);
+__off_t __sys_lseek(int, __off_t, int);
+void *__sys_mmap(void *, __size_t, int, int, int, __off_t);
+int __sys_msync(void *, __size_t, int);
+int __sys_nanosleep(const struct timespec *, struct timespec *);
+int __sys_open(const char *, int, ...);
+int __sys_openat(int, const char *, int, ...);
+int __sys_pselect(int, struct fd_set *, struct fd_set *,
+ struct fd_set *, const struct timespec *,
+ const __sigset_t *);
+int __sys_poll(struct pollfd *, unsigned, int);
+int __sys_ppoll(struct pollfd *, unsigned, const struct timespec *,
+ const __sigset_t *);
+__ssize_t __sys_pread(int, void *, __size_t, __off_t);
+__ssize_t __sys_pwrite(int, const void *, __size_t, __off_t);
+__ssize_t __sys_read(int, void *, __size_t);
+__ssize_t __sys_readv(int, const struct iovec *, int);
+__ssize_t __sys_recv(int, void *, __size_t, int);
+__ssize_t __sys_recvfrom(int, void *, __size_t, int, struct sockaddr *,
+ __socklen_t *);
+__ssize_t __sys_recvmsg(int, struct msghdr *, int);
+int __sys_select(int, struct fd_set *, struct fd_set *,
+ struct fd_set *, struct timeval *);
+__ssize_t __sys_sendmsg(int, const struct msghdr *, int);
+__ssize_t __sys_sendto(int, const void *, __size_t, int,
+ const struct sockaddr *, __socklen_t);
+int __sys_setcontext(const struct __ucontext *);
+int __sys_sigaction(int, const struct sigaction *,
+ struct sigaction *);
+int __sys_sigprocmask(int, const __sigset_t *, __sigset_t *);
+int __sys_sigsuspend(const __sigset_t *);
+int __sys_sigtimedwait(const __sigset_t *, struct __siginfo *,
+ const struct timespec *);
+int __sys_sigwait(const __sigset_t *, int *);
+int __sys_sigwaitinfo(const __sigset_t *, struct __siginfo *);
+int __sys_swapcontext(struct __ucontext *,
+ const struct __ucontext *);
+int __sys_thr_kill(long, int);
+int __sys_thr_self(long *);
+int __sys_truncate(const char *, __off_t);
+__pid_t __sys_wait4(__pid_t, int *, int, struct rusage *);
+__pid_t __sys_wait6(enum idtype, __id_t, int *, int,
+ struct __wrusage *, struct __siginfo *);
+__ssize_t __sys_write(int, const void *, __size_t);
+__ssize_t __sys_writev(int, const struct iovec *, int);
+
+int __libc_sigwait(const __sigset_t * __restrict,
+ int * restrict sig);
+int __libc_system(const char *);
+int __libc_tcdrain(int);
+int __fcntl_compat(int fd, int cmd, ...);
+
+int __sys_futimens(int fd, const struct timespec *times) __hidden;
+int __sys_utimensat(int fd, const char *path,
+ const struct timespec *times, int flag) __hidden;
/* execve() with PATH processing to implement posix_spawnp() */
int _execvpe(const char *, char * const *, char * const *);
diff --git a/lib/libc/locale/cXXrtomb_iconv.h b/lib/libc/locale/cXXrtomb_iconv.h
index 0ea553bc0809..d6e7ce0ae3ac 100644
--- a/lib/libc/locale/cXXrtomb_iconv.h
+++ b/lib/libc/locale/cXXrtomb_iconv.h
@@ -57,8 +57,7 @@ cXXrtomb_l(char * __restrict s, charXX_t c, mbstate_t * __restrict ps,
{
_ConversionState *cs;
struct _citrus_iconv *handle;
- const char *src;
- char *dst;
+ char *src, *dst;
size_t srcleft, dstleft, invlen;
int err;
diff --git a/lib/libc/locale/digittoint.3 b/lib/libc/locale/digittoint.3
index 4a7f2e2107ad..6670abe424ab 100644
--- a/lib/libc/locale/digittoint.3
+++ b/lib/libc/locale/digittoint.3
@@ -64,5 +64,5 @@ the function will return 0.
.Sh SEE ALSO
.Xr ctype 3 ,
.Xr isdigit 3 ,
-.Xr isxdigit 3,
+.Xr isxdigit 3 ,
.Xr xlocale 3
diff --git a/lib/libc/locale/duplocale.3 b/lib/libc/locale/duplocale.3
index f2e82158ae0e..bc0c4bced812 100644
--- a/lib/libc/locale/duplocale.3
+++ b/lib/libc/locale/duplocale.3
@@ -36,7 +36,7 @@
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In xlocale.h
+.In locale.h
.Ft locale_t
.Fn duplocale "locale_t locale"
.Sh DESCRIPTION
diff --git a/lib/libc/locale/freelocale.3 b/lib/libc/locale/freelocale.3
index 86f4809d6cac..0df80e7892cd 100644
--- a/lib/libc/locale/freelocale.3
+++ b/lib/libc/locale/freelocale.3
@@ -38,7 +38,7 @@ or
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In xlocale.h
+.In locale.h
.Ft int
.Fn freelocale "locale_t locale"
.Sh DESCRIPTION
diff --git a/lib/libc/locale/mbrtocXX_iconv.h b/lib/libc/locale/mbrtocXX_iconv.h
index ac85a5a5a782..9eb6f6831eb6 100644
--- a/lib/libc/locale/mbrtocXX_iconv.h
+++ b/lib/libc/locale/mbrtocXX_iconv.h
@@ -99,8 +99,7 @@ mbrtocXX_l(charXX_t * __restrict pc, const char * __restrict s, size_t n,
/* Convert as few characters to the dst buffer as possible. */
for (i = 0; ; i++) {
- const char *src;
- char *dst;
+ char *src, *dst;
size_t srcleft, dstleft, invlen;
int err;
diff --git a/lib/libc/locale/newlocale.3 b/lib/libc/locale/newlocale.3
index a639c372a6c6..c7414be73d3a 100644
--- a/lib/libc/locale/newlocale.3
+++ b/lib/libc/locale/newlocale.3
@@ -35,7 +35,7 @@
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In xlocale
+.In locale.h
.Ft locale_t
.Fn newlocale "int mask" "const char * locale" "locale_t base"
.Sh DESCRIPTION
diff --git a/lib/libc/locale/none.c b/lib/libc/locale/none.c
index 75adffaa96df..cacfd738e7c5 100644
--- a/lib/libc/locale/none.c
+++ b/lib/libc/locale/none.c
@@ -209,7 +209,7 @@ struct xlocale_ctype __xlocale_global_ctype = {
256 /* __mb_sb_limit */
};
-const struct xlocale_ctype __xlocale_C_ctype = {
+struct xlocale_ctype __xlocale_C_ctype = {
{{0}, "C"},
(_RuneLocale*)&_DefaultRuneLocale,
_none_mbrtowc,
diff --git a/lib/libc/locale/querylocale.3 b/lib/libc/locale/querylocale.3
index f90d626d1ac6..d1bb688ed907 100644
--- a/lib/libc/locale/querylocale.3
+++ b/lib/libc/locale/querylocale.3
@@ -36,7 +36,7 @@
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In xlocale.h
+.In locale.h
.Ft const char *
.Fn querylocale "int mask" "locale_t locale"
.Sh DESCRIPTION
diff --git a/lib/libc/locale/uselocale.3 b/lib/libc/locale/uselocale.3
index df29a625e17e..96d0008f7837 100644
--- a/lib/libc/locale/uselocale.3
+++ b/lib/libc/locale/uselocale.3
@@ -36,7 +36,7 @@
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In xlocale.h
+.In locale.h
.Ft locale_t
.Fn uselocale "locale_t locale"
.Sh DESCRIPTION
diff --git a/lib/libc/locale/xlocale.3 b/lib/libc/locale/xlocale.3
index d467a1004f24..da217c601100 100644
--- a/lib/libc/locale/xlocale.3
+++ b/lib/libc/locale/xlocale.3
@@ -71,7 +71,7 @@ function.
.Xr localeconv 3 ,
.Xr newlocale 3 ,
.Xr querylocale 3 ,
-.Xr uselocale 3 ,
+.Xr uselocale 3
.Sh CONVENIENCE FUNCTIONS
The xlocale API includes a number of
.Fa _l
diff --git a/lib/libc/mips/gen/Makefile.inc b/lib/libc/mips/gen/Makefile.inc
index 9d9cc7aaedfa..a186fda62036 100644
--- a/lib/libc/mips/gen/Makefile.inc
+++ b/lib/libc/mips/gen/Makefile.inc
@@ -6,5 +6,6 @@ SRCS+= infinity.c fabs.c ldexp.c
# SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
# fpsetround.c fpsetsticky.c
-SRCS+= _ctx_start.S _set_tp.c _setjmp.S getcontextx.c makecontext.c \
- setjmp.S signalcontext.c sigsetjmp.S
+SRCS+= _ctx_start.S _set_tp.c _setjmp.S makecontext.c \
+ setjmp.S signalcontext.c sigsetjmp.S \
+ trivial-getcontextx.c
diff --git a/lib/libc/mips/gen/_setjmp.S b/lib/libc/mips/gen/_setjmp.S
index 3918407038c6..0f7a75a82a6d 100644
--- a/lib/libc/mips/gen/_setjmp.S
+++ b/lib/libc/mips/gen/_setjmp.S
@@ -61,9 +61,16 @@ __FBSDID("$FreeBSD$");
LEAF(_setjmp)
REG_PROLOGUE
- REG_LI v0, _JB_MAGIC__SETJMP
+ REG_LI v0, _JB_MAGIC__SETJMP # sigcontext magic number
REG_S v0, (_JB_MAGIC * SZREG)(a0)
REG_S ra, (_JB_REG_RA * SZREG)(a0)
+ /*
+ * From "MIPSpro N32 ABI Handbook", Table 2-1:
+ * Registers s0..s7 are callee-saved.
+ * The sp register is callee-saved.
+ * The fp (or s8) register is callee-saved.
+ * The gp register is callee-saved (for n32/n64).
+ */
REG_S s0, (_JB_REG_S0 * SZREG)(a0)
REG_S s1, (_JB_REG_S1 * SZREG)(a0)
REG_S s2, (_JB_REG_S2 * SZREG)(a0)
@@ -72,11 +79,41 @@ LEAF(_setjmp)
REG_S s5, (_JB_REG_S5 * SZREG)(a0)
REG_S s6, (_JB_REG_S6 * SZREG)(a0)
REG_S s7, (_JB_REG_S7 * SZREG)(a0)
+ REG_S sp, (_JB_REG_SP * SZREG)(a0)
REG_S s8, (_JB_REG_S8 * SZREG)(a0)
#if defined(__mips_n32) || defined(__mips_n64)
REG_S gp, (_JB_REG_GP * SZREG)(a0) # newabi gp is callee-saved
#endif
- REG_S sp, (_JB_REG_SP * SZREG)(a0)
+ /*
+ * From "MIPSpro N32 ABI Handbook", Table 2-1:
+ * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
+ * In N64, FP registers F24 .. F31 are callee-saved.
+ * In O32, FP registers F20 .. F23 are callee-saved.
+ */
+#ifndef SOFTFLOAT
+ cfc1 v0, $31 # too bad can't check if FP used
+#if defined(__mips_n64) || defined(__mips_n32)
+ FP_S $f30, (_JB_FPREG_F30 * SZREG)(a0)
+ FP_S $f28, (_JB_FPREG_F28 * SZREG)(a0)
+ FP_S $f26, (_JB_FPREG_F26 * SZREG)(a0)
+ FP_S $f24, (_JB_FPREG_F24 * SZREG)(a0)
+#endif
+#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
+ FP_S $f22, (_JB_FPREG_F22 * SZREG)(a0)
+ FP_S $f20, (_JB_FPREG_F20 * SZREG)(a0)
+#endif
+#if defined(__mips_o32) || defined(__mips_o64)
+ FP_S $f21, (_JB_FPREG_F21 * SZREG)(a0)
+ FP_S $f23, (_JB_FPREG_F23 * SZREG)(a0)
+#endif
+#if defined(__mips_n64)
+ FP_S $f25, (_JB_FPREG_F25 * SZREG)(a0)
+ FP_S $f27, (_JB_FPREG_F27 * SZREG)(a0)
+ FP_S $f29, (_JB_FPREG_F29 * SZREG)(a0)
+ FP_S $f31, (_JB_FPREG_F31 * SZREG)(a0)
+#endif
+ INT_S v0, (_JB_FPREG_FCSR * SZREG)(a0)
+#endif /* ! SOFTFLOAT */
REG_EPILOGUE
j ra
@@ -94,6 +131,13 @@ LEAF(_longjmp)
REG_LI t0, _JB_MAGIC__SETJMP
bne v0, t0, botch # jump if error
PTR_ADDU sp, sp, CALLFRAME_SIZ # does not matter, sanity
+ /*
+ * From "MIPSpro N32 ABI Handbook", Table 2-1:
+ * Registers s0..s7 are callee-saved.
+ * The sp register is callee-saved.
+ * The fp (or s8) register is callee-saved.
+ * The gp register is callee-saved (for n32/n64).
+ */
REG_L s0, (_JB_REG_S0 * SZREG)(a0)
REG_L s1, (_JB_REG_S1 * SZREG)(a0)
REG_L s2, (_JB_REG_S2 * SZREG)(a0)
@@ -102,11 +146,42 @@ LEAF(_longjmp)
REG_L s5, (_JB_REG_S5 * SZREG)(a0)
REG_L s6, (_JB_REG_S6 * SZREG)(a0)
REG_L s7, (_JB_REG_S7 * SZREG)(a0)
+ REG_L sp, (_JB_REG_SP * SZREG)(a0)
+ REG_L s8, (_JB_REG_S8 * SZREG)(a0)
#if defined(__mips_n32) || defined(__mips_n64)
REG_L gp, (_JB_REG_GP * SZREG)(a0)
#endif
- REG_L sp, (_JB_REG_SP * SZREG)(a0)
- REG_L s8, (_JB_REG_S8 * SZREG)(a0)
+#ifndef SOFTFLOAT
+ # get fpu status
+ INT_L v0, (_JB_FPREG_FCSR * SZREG)(a0)
+ ctc1 v0, $31
+ /*
+ * From "MIPSpro N32 ABI Handbook", Table 2-1:
+ * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
+ * In N64, FP registers F24 .. F31 are callee-saved.
+ * In O32, FP registers F20 .. F23 are callee-saved.
+ */
+#if defined(__mips_n64) || defined(__mips_n32)
+ FP_L $f30, (_JB_FPREG_F30 * SZREG)(a0)
+ FP_L $f28, (_JB_FPREG_F28 * SZREG)(a0)
+ FP_L $f26, (_JB_FPREG_F26 * SZREG)(a0)
+ FP_L $f24, (_JB_FPREG_F24 * SZREG)(a0)
+#endif
+#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
+ FP_L $f22, (_JB_FPREG_F22 * SZREG)(a0)
+ FP_L $f20, (_JB_FPREG_F20 * SZREG)(a0)
+#endif
+#if defined(__mips_o32) || defined(__mips_o64)
+ FP_L $f21, (_JB_FPREG_F21 * SZREG)(a0)
+ FP_L $f23, (_JB_FPREG_F23 * SZREG)(a0)
+#endif
+#if defined(__mips_n64)
+ FP_L $f25, (_JB_FPREG_F25 * SZREG)(a0)
+ FP_L $f27, (_JB_FPREG_F27 * SZREG)(a0)
+ FP_L $f29, (_JB_FPREG_F29 * SZREG)(a0)
+ FP_L $f31, (_JB_FPREG_F31 * SZREG)(a0)
+#endif
+#endif /* ! SOFTFLOAT */
REG_EPILOGUE
move v0, a1 # get return value in 1st arg
diff --git a/lib/libc/mips/gen/getcontextx.c b/lib/libc/mips/gen/getcontextx.c
deleted file mode 100644
index 54f851384811..000000000000
--- a/lib/libc/mips/gen/getcontextx.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2011 Konstantin Belousov <kib@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/ucontext.h>
-#include <errno.h>
-#include <stdlib.h>
-
-int
-__getcontextx_size(void)
-{
-
- return (sizeof(ucontext_t));
-}
-
-int
-__fillcontextx2(char *ctx)
-{
-
- return (0);
-}
-
-int
-__fillcontextx(char *ctx)
-{
- ucontext_t *ucp;
-
- ucp = (ucontext_t *)ctx;
- return (getcontext(ucp));
-}
-
-__weak_reference(__getcontextx, getcontextx);
-
-ucontext_t *
-__getcontextx(void)
-{
- char *ctx;
- int error;
-
- ctx = malloc(__getcontextx_size());
- if (ctx == NULL)
- return (NULL);
- if (__fillcontextx(ctx) == -1) {
- error = errno;
- free(ctx);
- errno = error;
- return (NULL);
- }
- return ((ucontext_t *)ctx);
-}
diff --git a/lib/libc/mips/gen/setjmp.S b/lib/libc/mips/gen/setjmp.S
index deeb8924e308..9c9e8b8d9ee0 100644
--- a/lib/libc/mips/gen/setjmp.S
+++ b/lib/libc/mips/gen/setjmp.S
@@ -86,6 +86,13 @@ NESTED(setjmp, SETJMP_FRAME_SIZE, ra)
REG_LI v0, _JB_MAGIC_SETJMP
REG_S v0, (_JB_MAGIC * SZREG)(a0)
REG_S ra, (_JB_REG_RA * SZREG)(a0)
+ /*
+ * From "MIPSpro N32 ABI Handbook", Table 2-1:
+ * Registers s0..s7 are callee-saved.
+ * The sp register is callee-saved.
+ * The fp (or s8) register is callee-saved.
+ * The gp register is callee-saved (for n32/n64).
+ */
REG_S s0, (_JB_REG_S0 * SZREG)(a0)
REG_S s1, (_JB_REG_S1 * SZREG)(a0)
REG_S s2, (_JB_REG_S2 * SZREG)(a0)
@@ -99,6 +106,36 @@ NESTED(setjmp, SETJMP_FRAME_SIZE, ra)
#if defined(__mips_n32) || defined(__mips_n64)
REG_S gp, (_JB_REG_GP * SZREG)(a0)
#endif
+#ifndef SOFTFLOAT
+ /*
+ * From "MIPSpro N32 ABI Handbook", Table 2-1:
+ * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
+ * In N64, FP registers F24 .. F31 are callee-saved.
+ * In O32, FP registers F20 .. F23 are callee-saved.
+ */
+ cfc1 v0, $31
+ INT_S v0, (_JB_FPREG_FCSR * SZREG)(a0)
+#if defined(__mips_o32) || defined(__mips_o64) || defined(__mips_n32)
+ FP_S $f20, (_JB_FPREG_F20 * SZREG)(a0)
+ FP_S $f22, (_JB_FPREG_F22 * SZREG)(a0)
+#endif
+#if defined(__mips_o32) || defined(__mips_o64)
+ FP_S $f21, (_JB_FPREG_F21 * SZREG)(a0)
+ FP_S $f23, (_JB_FPREG_F23 * SZREG)(a0)
+#endif
+#if defined(__mips_n32) || defined(__mips_n64)
+ FP_S $f24, (_JB_FPREG_F24 * SZREG)(a0)
+ FP_S $f26, (_JB_FPREG_F26 * SZREG)(a0)
+ FP_S $f28, (_JB_FPREG_F28 * SZREG)(a0)
+ FP_S $f30, (_JB_FPREG_F30 * SZREG)(a0)
+#endif
+#if defined(__mips_n64)
+ FP_S $f25, (_JB_FPREG_F25 * SZREG)(a0)
+ FP_S $f27, (_JB_FPREG_F27 * SZREG)(a0)
+ FP_S $f29, (_JB_FPREG_F29 * SZREG)(a0)
+ FP_S $f31, (_JB_FPREG_F31 * SZREG)(a0)
+#endif
+#endif /* ! SOFTFLOAT */
move v0, zero
jr ra
@@ -133,6 +170,13 @@ NESTED(longjmp, LONGJMP_FRAME_SIZE, ra)
REG_L a1, (CALLFRAME_SIZ + SZREG)(sp) # restore return value
REG_L ra, (_JB_REG_RA * SZREG)(a0)
+ /*
+ * From "MIPSpro N32 ABI Handbook", Table 2-1:
+ * Registers s0..s7 are callee-saved.
+ * The sp register is callee-saved.
+ * The fp (or s8) register is callee-saved.
+ * The gp register is callee-saved (for n32/n64).
+ */
REG_L s0, (_JB_REG_S0 * SZREG)(a0)
REG_L s1, (_JB_REG_S1 * SZREG)(a0)
REG_L s2, (_JB_REG_S2 * SZREG)(a0)
@@ -146,6 +190,36 @@ NESTED(longjmp, LONGJMP_FRAME_SIZE, ra)
#if defined(__mips_n32) || defined(__mips_n64)
REG_L gp, (_JB_REG_GP * SZREG)(a0)
#endif
+#ifndef SOFTFLOAT
+ /*
+ * From "MIPSpro N32 ABI Handbook", Table 2-1:
+ * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
+ * In N64, FP registers F23 .. F31 are callee-saved.
+ * In O32, FP registers F20 .. F23 are callee-saved.
+ */
+ INT_L v0, (_JB_FPREG_FCSR * SZREG)(a0)
+ ctc1 v0, $31
+#if defined(__mips_n64) || defined(__mips_n32)
+ FP_L $f30, (_JB_FPREG_F30 * SZREG)(a0)
+ FP_L $f28, (_JB_FPREG_F28 * SZREG)(a0)
+ FP_L $f26, (_JB_FPREG_F26 * SZREG)(a0)
+ FP_L $f24, (_JB_FPREG_F24 * SZREG)(a0)
+#endif
+#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
+ FP_L $f22, (_JB_FPREG_F22 * SZREG)(a0)
+ FP_L $f20, (_JB_FPREG_F20 * SZREG)(a0)
+#endif
+#if defined(__mips_o32) || defined(__mips_o64)
+ FP_L $f21, (_JB_FPREG_F21 * SZREG)(a0)
+ FP_L $f23, (_JB_FPREG_F23 * SZREG)(a0)
+#endif
+#if defined(__mips_n64)
+ FP_L $f25, (_JB_FPREG_F25 * SZREG)(a0)
+ FP_L $f27, (_JB_FPREG_F27 * SZREG)(a0)
+ FP_L $f29, (_JB_FPREG_F29 * SZREG)(a0)
+ FP_L $f31, (_JB_FPREG_F31 * SZREG)(a0)
+#endif
+#endif /* ! SOFTFLOAT */
move v0, a1
j ra
diff --git a/lib/libc/mips/gen/sigsetjmp.S b/lib/libc/mips/gen/sigsetjmp.S
index 7705c29a46b1..41c47f284433 100644
--- a/lib/libc/mips/gen/sigsetjmp.S
+++ b/lib/libc/mips/gen/sigsetjmp.S
@@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$");
LEAF(sigsetjmp)
PIC_PROLOGUE(sigsetjmp)
- bne a1, 0x0, 1f # do saving of signal mask?
+ bne a1, zero, 1f # do saving of signal mask?
PIC_TAILCALL(_setjmp)
1: PIC_TAILCALL(setjmp)
diff --git a/lib/libc/mips/sys/Makefile.inc b/lib/libc/mips/sys/Makefile.inc
index c754f365a0b6..460e69b33fbf 100644
--- a/lib/libc/mips/sys/Makefile.inc
+++ b/lib/libc/mips/sys/Makefile.inc
@@ -1,15 +1,11 @@
# $FreeBSD$
-SRCS+= __vdso_gettc.c
+SRCS+= trivial-vdso_tc.c
MDASM= Ovfork.S brk.S cerror.S exect.S \
fork.S pipe.S ptrace.S sbrk.S syscall.S
# Don't generate default code for these syscalls:
-NOASM= break.o exit.o ftruncate.o getlogin.o lseek.o mmap.o \
- openbsd_poll.o pread.o pwrite.o sstk.o truncate.o vfork.o yield.o
+NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
PSEUDO= _exit.o _getlogin.o
-.if ${MK_SYSCALL_COMPAT} != "no"
-PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
-.endif
diff --git a/lib/libc/net/Symbol.map b/lib/libc/net/Symbol.map
index 2eddc4739579..01d3bcb888d0 100644
--- a/lib/libc/net/Symbol.map
+++ b/lib/libc/net/Symbol.map
@@ -124,6 +124,7 @@ FBSD_1.0 {
in6addr_nodelocal_allnodes;
in6addr_linklocal_allnodes;
sctp_getaddrlen;
+ sctp_getassocid;
sctp_bindx;
sctp_connectx;
sctp_peeloff;
diff --git a/lib/libc/net/base64.c b/lib/libc/net/base64.c
index 43350303898e..8a9c59e3142d 100644
--- a/lib/libc/net/base64.c
+++ b/lib/libc/net/base64.c
@@ -193,12 +193,10 @@ b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) {
*/
int
-b64_pton(src, target, targsize)
- char const *src;
- u_char *target;
- size_t targsize;
+b64_pton(const char *src, u_char *target, size_t targsize)
{
int tarindex, state, ch;
+ u_char nextbyte;
char *pos;
state = 0;
@@ -226,22 +224,28 @@ b64_pton(src, target, targsize)
break;
case 1:
if (target) {
- if ((size_t)tarindex + 1 >= targsize)
+ if ((size_t)tarindex >= targsize)
return (-1);
target[tarindex] |= (pos - Base64) >> 4;
- target[tarindex+1] = ((pos - Base64) & 0x0f)
- << 4 ;
+ nextbyte = ((pos - Base64) & 0x0f) << 4;
+ if ((size_t)tarindex + 1 < targsize)
+ target[tarindex + 1] = nextbyte;
+ else if (nextbyte)
+ return (-1);
}
tarindex++;
state = 2;
break;
case 2:
if (target) {
- if ((size_t)tarindex + 1 >= targsize)
+ if ((size_t)tarindex >= targsize)
return (-1);
target[tarindex] |= (pos - Base64) >> 2;
- target[tarindex+1] = ((pos - Base64) & 0x03)
- << 6;
+ nextbyte = ((pos - Base64) & 0x03) << 6;
+ if ((size_t)tarindex + 1 < targsize)
+ target[tarindex + 1] = nextbyte;
+ else if (nextbyte)
+ return (-1);
}
tarindex++;
state = 3;
@@ -299,7 +303,8 @@ b64_pton(src, target, targsize)
* zeros. If we don't check them, they become a
* subliminal channel.
*/
- if (target && target[tarindex] != 0)
+ if (target && (size_t)tarindex < targsize &&
+ target[tarindex] != 0)
return (-1);
}
} else {
diff --git a/lib/libc/net/eui64.c b/lib/libc/net/eui64.c
index d9ed76c915aa..bb3077f84693 100644
--- a/lib/libc/net/eui64.c
+++ b/lib/libc/net/eui64.c
@@ -132,6 +132,7 @@ eui64_line(const char *l, struct eui64 *e, char *hostname, size_t len)
goto bad;
}
+ free(linehead);
return (0);
bad:
diff --git a/lib/libc/net/getaddrinfo.3 b/lib/libc/net/getaddrinfo.3
index 5d03aab2a42c..570fc2e3bcb4 100644
--- a/lib/libc/net/getaddrinfo.3
+++ b/lib/libc/net/getaddrinfo.3
@@ -237,8 +237,8 @@ pointer in each
.Li addrinfo
structure until a null pointer is encountered.
The three members
-.Fa ai_family,
-.Fa ai_socktype,
+.Fa ai_family ,
+.Fa ai_socktype ,
and
.Fa ai_protocol
in each returned
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index c50374e7287a..17c9b651c375 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$");
#include <ifaddrs.h>
#include <sys/queue.h>
#ifdef INET6
-#include <net/if_var.h>
#include <sys/sysctl.h>
#include <sys/ioctl.h>
#include <netinet6/in6_var.h>
diff --git a/lib/libc/net/getifaddrs.3 b/lib/libc/net/getifaddrs.3
index ff3f77493a77..b0b17bb388da 100644
--- a/lib/libc/net/getifaddrs.3
+++ b/lib/libc/net/getifaddrs.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 21, 2013
+.Dd November 25, 2014
.Dt GETIFADDRS 3
.Os
.Sh NAME
@@ -110,19 +110,17 @@ if one exists, otherwise it is NULL.
.Pp
The
.Li ifa_data
-field references address family specific data.
-For
-.Dv AF_LINK
-addresses it contains a pointer to the
+field references address family specific data
+in a pointer to the
.Fa struct if_data
(as defined in include file
-.In net/if.h )
-which contains various interface attributes and statistics.
-For all other address families, it contains a pointer to the
-.Fa struct ifa_data
-(as defined in include file
-.In net/if.h )
-which contains per-address interface statistics.
+.In net/if.h ) .
+For
+.Dv AF_LINK
+addresses,
+it contains various interface attributes and statistics.
+For all other address families,
+it contains per-address interface statistics.
.Pp
The data returned by
.Fn getifaddrs
diff --git a/lib/libc/net/ip6opt.c b/lib/libc/net/ip6opt.c
index a467758de199..2f0c51d3d74b 100644
--- a/lib/libc/net/ip6opt.c
+++ b/lib/libc/net/ip6opt.c
@@ -419,7 +419,7 @@ inet6_opt_append(void *extbuf, socklen_t extlen, int offset, u_int8_t type,
* The option data length must have a value between 0 and 255,
* inclusive, and is the length of the option data that follows.
*/
- if (len < 0 || len > 255)
+ if (len > 255 || len < 0 )
return(-1);
/*
diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c
index 97880a25e7d8..89effe69a354 100644
--- a/lib/libc/net/name6.c
+++ b/lib/libc/net/name6.c
@@ -94,7 +94,6 @@ __FBSDID("$FreeBSD$");
#include <netinet/in.h>
#ifdef INET6
#include <net/if.h>
-#include <net/if_var.h>
#include <sys/sysctl.h>
#include <sys/ioctl.h>
#include <netinet6/in6_var.h> /* XXX */
diff --git a/lib/libc/net/nsdispatch.c b/lib/libc/net/nsdispatch.c
index c23315cbd108..4de1df3ffd16 100644
--- a/lib/libc/net/nsdispatch.c
+++ b/lib/libc/net/nsdispatch.c
@@ -132,14 +132,17 @@ static void *nss_cache_cycle_prevention_func = NULL;
#endif
/*
- * When this is set to 1, nsdispatch won't use nsswitch.conf
- * but will consult the 'defaults' source list only.
- * NOTE: nested fallbacks (when nsdispatch calls fallback functions,
- * which in turn calls nsdispatch, which should call fallback
- * function) are not supported
+ * We keep track of nsdispatch() nesting depth in dispatch_depth. When a
+ * fallback method is invoked from nsdispatch(), we temporarily set
+ * fallback_depth to the current dispatch depth plus one. Subsequent
+ * calls at that exact depth will run in fallback mode (restricted to the
+ * same source as the call that was handled by the fallback method), while
+ * calls below that depth will be handled normally, allowing fallback
+ * methods to perform arbitrary lookups.
*/
struct fb_state {
- int fb_dispatch;
+ int dispatch_depth;
+ int fallback_depth;
};
static void fb_endstate(void *);
NSS_TLS_HANDLING(fb);
@@ -613,6 +616,7 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database,
void *mdata;
int isthreaded, serrno, i, result, srclistsize;
struct fb_state *st;
+ int saved_depth;
#ifdef NS_CACHING
nss_cache_data cache_data;
@@ -644,7 +648,8 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database,
result = NS_UNAVAIL;
goto fin;
}
- if (st->fb_dispatch == 0) {
+ ++st->dispatch_depth;
+ if (st->dispatch_depth > st->fallback_depth) {
dbt = vector_search(&database, _nsmap, _nsmapsize, sizeof(*_nsmap),
string_compare);
fb_method = nss_method_lookup(NSSRC_FALLBACK, database,
@@ -713,12 +718,13 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database,
break;
} else {
if (fb_method != NULL) {
- st->fb_dispatch = 1;
+ saved_depth = st->fallback_depth;
+ st->fallback_depth = st->dispatch_depth + 1;
va_start(ap, defaults);
result = fb_method(retval,
(void *)srclist[i].name, ap);
va_end(ap);
- st->fb_dispatch = 0;
+ st->fallback_depth = saved_depth;
} else
nss_log(LOG_DEBUG, "%s, %s, %s, not found, "
"and no fallback provided",
@@ -750,6 +756,7 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database,
if (isthreaded)
(void)_pthread_rwlock_unlock(&nss_lock);
+ --st->dispatch_depth;
fin:
errno = serrno;
return (result);
diff --git a/lib/libc/net/recv.c b/lib/libc/net/recv.c
index f71d4780bb7c..6a584cadbff6 100644
--- a/lib/libc/net/recv.c
+++ b/lib/libc/net/recv.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/socket.h>
+#include "libc_private.h"
#include <stddef.h>
@@ -48,5 +49,8 @@ recv(s, buf, len, flags)
* POSIX says recv() shall be a cancellation point, so call the
* cancellation-enabled recvfrom() and not _recvfrom().
*/
- return (recvfrom(s, buf, len, flags, NULL, 0));
+ return (((ssize_t (*)(int, void *, size_t, int,
+ struct sockaddr *, socklen_t *))
+ __libc_interposing[INTERPOS_recvfrom])(s, buf, len, flags,
+ NULL, NULL));
}
diff --git a/lib/libc/net/sctp_recvmsg.3 b/lib/libc/net/sctp_recvmsg.3
index e3ced9c42a96..945797dc9e93 100644
--- a/lib/libc/net/sctp_recvmsg.3
+++ b/lib/libc/net/sctp_recvmsg.3
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 13, 2007
+.Dd April 23, 2015
.Dt SCTP_RECVMSG 3
.Os
.Sh NAME
@@ -98,13 +98,13 @@ receive buffer, then the
argument will
.Em not
have the
-.Dv MSG_EOF
+.Dv MSG_EOR
flag applied.
If the message is a complete message then
the
.Fa flags
argument will have
-.Dv MSG_EOF
+.Dv MSG_EOR
set.
Locally detected errors are
indicated by a return value of -1 with
@@ -282,12 +282,12 @@ This typically means that the socket
is not connected and is a one-to-one style socket.
.El
.Sh SEE ALSO
+.Xr getsockopt 2 ,
.Xr recv 2 ,
.Xr select 2 ,
+.Xr setsockopt 2 ,
.Xr socket 2 ,
.Xr write 2 ,
-.Xr getsockopt 2 ,
-.Xr setsockopt 2 ,
.Xr sctp_send 3 ,
.Xr sctp_sendmsg 3 ,
.Xr sendmsg 3 ,
diff --git a/lib/libc/net/sctp_send.3 b/lib/libc/net/sctp_send.3
index 37b0b7185b00..9c7f833918ba 100644
--- a/lib/libc/net/sctp_send.3
+++ b/lib/libc/net/sctp_send.3
@@ -337,7 +337,7 @@ is not connected and is a one-to-one style socket.
.Xr select 2 ,
.Xr sendmsg 2 ,
.Xr socket 2 ,
-.Xr write 2
+.Xr write 2 ,
.Xr sctp_connectx 3 ,
.Xr sctp_recvmsg 3 ,
.Xr sctp_sendmsg 3 ,
diff --git a/lib/libc/net/sctp_sys_calls.c b/lib/libc/net/sctp_sys_calls.c
index 91527c353fce..f07aa4321ca8 100644
--- a/lib/libc/net/sctp_sys_calls.c
+++ b/lib/libc/net/sctp_sys_calls.c
@@ -383,6 +383,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, int opt, void *arg, socklen_t * size)
case SCTP_PR_ASSOC_STATUS:
((struct sctp_prstatus *)arg)->sprstat_assoc_id = id;
break;
+ case SCTP_MAX_CWND:
+ ((struct sctp_assoc_value *)arg)->assoc_id = id;
+ break;
default:
break;
}
@@ -597,6 +600,7 @@ sctp_sendmsg(int s,
msg.msg_iovlen = 1;
msg.msg_control = cmsgbuf;
msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo));
+ msg.msg_flags = 0;
cmsg = (struct cmsghdr *)cmsgbuf;
cmsg->cmsg_level = IPPROTO_SCTP;
cmsg->cmsg_type = SCTP_SNDRCV;
@@ -663,6 +667,7 @@ sctp_send(int sd, const void *data, size_t len,
msg.msg_iovlen = 1;
msg.msg_control = cmsgbuf;
msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo));
+ msg.msg_flags = 0;
cmsg = (struct cmsghdr *)cmsgbuf;
cmsg->cmsg_level = IPPROTO_SCTP;
cmsg->cmsg_type = SCTP_SNDRCV;
@@ -820,7 +825,6 @@ sctp_recvmsg(int s,
errno = EINVAL;
return (-1);
}
- msg.msg_flags = 0;
iov.iov_base = dbuf;
iov.iov_len = len;
msg.msg_name = (caddr_t)from;
@@ -832,6 +836,7 @@ sctp_recvmsg(int s,
msg.msg_iovlen = 1;
msg.msg_control = cmsgbuf;
msg.msg_controllen = sizeof(cmsgbuf);
+ msg.msg_flags = 0;
sz = recvmsg(s, &msg, *msg_flags);
*msg_flags = msg.msg_flags;
if (sz <= 0) {
@@ -886,7 +891,7 @@ sctp_recvv(int sd,
struct sctp_rcvinfo *rcvinfo;
struct sctp_nxtinfo *nxtinfo;
- if (((info != NULL) && (infolen == NULL)) |
+ if (((info != NULL) && (infolen == NULL)) ||
((info == NULL) && (infolen != NULL) && (*infolen != 0)) ||
((info != NULL) && (infotype == NULL))) {
errno = EINVAL;
@@ -905,6 +910,7 @@ sctp_recvv(int sd,
msg.msg_iovlen = iovlen;
msg.msg_control = cmsgbuf;
msg.msg_controllen = sizeof(cmsgbuf);
+ msg.msg_flags = 0;
ret = recvmsg(sd, &msg, *flags);
*flags = msg.msg_flags;
if ((ret > 0) &&
diff --git a/lib/libc/net/send.c b/lib/libc/net/send.c
index 93cdfda17532..c44f4b922a81 100644
--- a/lib/libc/net/send.c
+++ b/lib/libc/net/send.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/socket.h>
+#include "libc_private.h"
#include <stddef.h>
@@ -48,5 +49,8 @@ send(s, msg, len, flags)
* POSIX says send() shall be a cancellation point, so call the
* cancellation-enabled sendto() and not _sendto().
*/
- return (sendto(s, msg, len, flags, NULL, 0));
+ return (((ssize_t (*)(int, const void *, size_t, int,
+ const struct sockaddr *, socklen_t))
+ __libc_interposing[INTERPOS_sendto])(s, msg, len, flags,
+ NULL, 0));
}
diff --git a/lib/libc/nls/catopen.3 b/lib/libc/nls/catopen.3
index 7a16ee50408a..7744b0bd864c 100644
--- a/lib/libc/nls/catopen.3
+++ b/lib/libc/nls/catopen.3
@@ -94,7 +94,7 @@ An empty string is substituted for undefined values.
Path names templates defined in
.Ev NLSPATH
are separated by colons
-.No ( Sq \&: ) .
+.Pq Sq \&: .
A leading or two adjacent colons
is equivalent to specifying %N.
.Pp
diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c
index 2859916fd8fd..0cba460403b3 100644
--- a/lib/libc/nls/msgcat.c
+++ b/lib/libc/nls/msgcat.c
@@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$");
np->name = strdup(n); \
np->path = NULL; \
np->catd = NLERR; \
+ np->refcount = 0; \
np->lang = (l == NULL) ? NULL : \
strdup(l); \
np->caterrno = e; \
diff --git a/lib/libc/posix1e/acl_calc_mask.c b/lib/libc/posix1e/acl_calc_mask.c
index a2d15276bf3e..56215b9094c6 100644
--- a/lib/libc/posix1e/acl_calc_mask.c
+++ b/lib/libc/posix1e/acl_calc_mask.c
@@ -104,6 +104,7 @@ acl_calc_mask(acl_t *acl_p)
/* if no mask exists, check acl_cnt... */
if (acl_int_new->acl_cnt == ACL_MAX_ENTRIES) {
errno = ENOMEM;
+ acl_free(acl_new);
return (-1);
}
/* ...and add the mask entry */
diff --git a/lib/libc/posix1e/acl_set_flagset_np.3 b/lib/libc/posix1e/acl_set_flagset_np.3
index 2230c4866b76..685680d3b351 100644
--- a/lib/libc/posix1e/acl_set_flagset_np.3
+++ b/lib/libc/posix1e/acl_set_flagset_np.3
@@ -64,9 +64,9 @@ ACL is already branded as POSIX.1e.
.Sh SEE ALSO
.Xr acl 3 ,
.Xr acl_add_flag_np 3 ,
-.Xr acl_get_brand_np 3 ,
.Xr acl_clear_flags_np 3 ,
.Xr acl_delete_flag_np 3 ,
+.Xr acl_get_brand_np 3 ,
.Xr acl_get_flagset_np 3 ,
.Xr posix1e 3
.Sh STANDARDS
diff --git a/lib/libc/posix1e/acl_strip.c b/lib/libc/posix1e/acl_strip.c
index ae37b38a137a..85dfb4721a3c 100644
--- a/lib/libc/posix1e/acl_strip.c
+++ b/lib/libc/posix1e/acl_strip.c
@@ -82,8 +82,10 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculate_mask)
have_mask_entry = 0;
acl_new = acl_init(ACL_MAX_ENTRIES);
- if (acl_new == NULL)
+ if (acl_new == NULL) {
+ acl_free(acl_old);
return (NULL);
+ }
tag = ACL_UNDEFINED_TAG;
/* only save the default user/group/other entries */
@@ -94,16 +96,16 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculate_mask)
assert(_entry_brand(entry) == ACL_BRAND_POSIX);
if (acl_get_tag_type(entry, &tag) == -1)
- return (NULL);
+ goto fail;
switch(tag) {
case ACL_USER_OBJ:
case ACL_GROUP_OBJ:
case ACL_OTHER:
if (acl_get_tag_type(entry, &tag) == -1)
- return (NULL);
+ goto fail;
if (acl_get_permset(entry, &perm) == -1)
- return (NULL);
+ goto fail;
if (acl_create_entry(&acl_new, &entry_new) == -1)
return (NULL);
if (acl_set_tag_type(entry_new, tag) == -1)
@@ -120,6 +122,10 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculate_mask)
default:
break;
}
+fail:
+ acl_free(acl_new);
+ acl_free(acl_old);
+ return (NULL);
}
assert(_acl_brand(acl_new) == ACL_BRAND_POSIX);
diff --git a/lib/libc/powerpc/Makefile.inc b/lib/libc/powerpc/Makefile.inc
index f3787806143e..429826711c44 100644
--- a/lib/libc/powerpc/Makefile.inc
+++ b/lib/libc/powerpc/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-SRCS+= __vdso_gettc.c
+SRCS+= trivial-vdso_tc.c
# Long double is 64-bits
MDSRCS+=machdep_ldisd.c
diff --git a/lib/libc/powerpc/gen/Makefile.inc b/lib/libc/powerpc/gen/Makefile.inc
index 81c6a698fac8..2a00ba332b94 100644
--- a/lib/libc/powerpc/gen/Makefile.inc
+++ b/lib/libc/powerpc/gen/Makefile.inc
@@ -1,9 +1,11 @@
# $FreeBSD$
SRCS += _ctx_start.S eabi.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \
- fpgetsticky.c fpsetmask.c fpsetround.c getcontextx.c \
+ fpgetsticky.c fpsetmask.c fpsetround.c \
infinity.c ldexp.c makecontext.c _setjmp.S \
setjmp.S sigsetjmp.S signalcontext.c syncicache.c \
- _set_tp.c
+ _set_tp.c \
+ trivial-getcontextx.c
+
diff --git a/lib/libc/powerpc/gen/_set_tp.c b/lib/libc/powerpc/gen/_set_tp.c
index 5a89698b82c5..aa1150a5dd16 100644
--- a/lib/libc/powerpc/gen/_set_tp.c
+++ b/lib/libc/powerpc/gen/_set_tp.c
@@ -29,7 +29,6 @@
void
_set_tp(void *tpval)
{
- register void *tp __asm__("r2");
- __asm __volatile("mr %0,%1" : "=r"(tp) : "r"((char*)tpval + 0x7008));
+ __asm __volatile("mr 2,%0" :: "r"((char*)tpval + 0x7008));
}
diff --git a/lib/libc/powerpc/gen/_setjmp.S b/lib/libc/powerpc/gen/_setjmp.S
index e28386c24b9c..663a8b6ed32a 100644
--- a/lib/libc/powerpc/gen/_setjmp.S
+++ b/lib/libc/powerpc/gen/_setjmp.S
@@ -56,12 +56,54 @@ ENTRY(_setjmp)
mr %r10,%r1
mr %r9,%r2
stmw %r9,20(%r3)
+
+ /* FPRs */
+ stfd %f14,112+0*8(%r3)
+ stfd %f15,112+1*8(%r3)
+ stfd %f16,112+2*8(%r3)
+ stfd %f17,112+3*8(%r3)
+ stfd %f18,112+4*8(%r3)
+ stfd %f19,112+5*8(%r3)
+ stfd %f20,112+6*8(%r3)
+ stfd %f21,112+7*8(%r3)
+ stfd %f22,112+8*8(%r3)
+ stfd %f23,112+9*8(%r3)
+ stfd %f24,112+10*8(%r3)
+ stfd %f25,112+11*8(%r3)
+ stfd %f26,112+12*8(%r3)
+ stfd %f27,112+13*8(%r3)
+ stfd %f28,112+14*8(%r3)
+ stfd %f29,112+15*8(%r3)
+ stfd %f30,112+16*8(%r3)
+ stfd %f31,112+17*8(%r3)
+
li %r3,0
blr
END(_setjmp)
ENTRY(_longjmp)
lmw %r9,20(%r3)
+
+ /* FPRs */
+ lfd %f14,112+0*8(%r3)
+ lfd %f15,112+1*8(%r3)
+ lfd %f16,112+2*8(%r3)
+ lfd %f17,112+3*8(%r3)
+ lfd %f18,112+4*8(%r3)
+ lfd %f19,112+5*8(%r3)
+ lfd %f20,112+6*8(%r3)
+ lfd %f21,112+7*8(%r3)
+ lfd %f22,112+8*8(%r3)
+ lfd %f23,112+9*8(%r3)
+ lfd %f24,112+10*8(%r3)
+ lfd %f25,112+11*8(%r3)
+ lfd %f26,112+12*8(%r3)
+ lfd %f27,112+13*8(%r3)
+ lfd %f28,112+14*8(%r3)
+ lfd %f29,112+15*8(%r3)
+ lfd %f30,112+16*8(%r3)
+ lfd %f31,112+17*8(%r3)
+
mtlr %r11
mtcr %r12
mr %r1,%r10
diff --git a/lib/libc/powerpc/gen/setjmp.S b/lib/libc/powerpc/gen/setjmp.S
index 9325fc2378cb..ef7cb7e7be6e 100644
--- a/lib/libc/powerpc/gen/setjmp.S
+++ b/lib/libc/powerpc/gen/setjmp.S
@@ -66,6 +66,27 @@ ENTRY(setjmp)
mr %r10,%r1 /* r10 <- stackptr */
mr %r9,%r2 /* r9 <- global ptr */
stmw %r9,20(%r6)
+
+ /* FPRs */
+ stfd %f14,112+0*8(%r6)
+ stfd %f15,112+1*8(%r6)
+ stfd %f16,112+2*8(%r6)
+ stfd %f17,112+3*8(%r6)
+ stfd %f18,112+4*8(%r6)
+ stfd %f19,112+5*8(%r6)
+ stfd %f20,112+6*8(%r6)
+ stfd %f21,112+7*8(%r6)
+ stfd %f22,112+8*8(%r6)
+ stfd %f23,112+9*8(%r6)
+ stfd %f24,112+10*8(%r6)
+ stfd %f25,112+11*8(%r6)
+ stfd %f26,112+12*8(%r6)
+ stfd %f27,112+13*8(%r6)
+ stfd %f28,112+14*8(%r6)
+ stfd %f29,112+15*8(%r6)
+ stfd %f30,112+16*8(%r6)
+ stfd %f31,112+17*8(%r6)
+
li %r3,0 /* return (0) */
blr
END(setjmp)
@@ -73,6 +94,27 @@ END(setjmp)
WEAK_REFERENCE(CNAME(__longjmp), longjmp)
ENTRY(__longjmp)
lmw %r9,20(%r3) /* restore regs */
+
+ /* FPRs */
+ lfd %f14,112+0*8(%r3)
+ lfd %f15,112+1*8(%r3)
+ lfd %f16,112+2*8(%r3)
+ lfd %f17,112+3*8(%r3)
+ lfd %f18,112+4*8(%r3)
+ lfd %f19,112+5*8(%r3)
+ lfd %f20,112+6*8(%r3)
+ lfd %f21,112+7*8(%r3)
+ lfd %f22,112+8*8(%r3)
+ lfd %f23,112+9*8(%r3)
+ lfd %f24,112+10*8(%r3)
+ lfd %f25,112+11*8(%r3)
+ lfd %f26,112+12*8(%r3)
+ lfd %f27,112+13*8(%r3)
+ lfd %f28,112+14*8(%r3)
+ lfd %f29,112+15*8(%r3)
+ lfd %f30,112+16*8(%r3)
+ lfd %f31,112+17*8(%r3)
+
mr %r6,%r4 /* save val param */
mtlr %r11 /* r11 -> link reg */
mtcr %r12 /* r12 -> condition reg */
diff --git a/lib/libc/powerpc/gen/sigsetjmp.S b/lib/libc/powerpc/gen/sigsetjmp.S
index c67afc610316..9c75f4f86dd7 100644
--- a/lib/libc/powerpc/gen/sigsetjmp.S
+++ b/lib/libc/powerpc/gen/sigsetjmp.S
@@ -71,12 +71,54 @@ ENTRY(sigsetjmp)
mr %r10,%r1
mr %r9,%r2
stmw %r9,20(%r6)
+
+ /* FPRs */
+ stfd %f14,112+0*8(%r6)
+ stfd %f15,112+1*8(%r6)
+ stfd %f16,112+2*8(%r6)
+ stfd %f17,112+3*8(%r6)
+ stfd %f18,112+4*8(%r6)
+ stfd %f19,112+5*8(%r6)
+ stfd %f20,112+6*8(%r6)
+ stfd %f21,112+7*8(%r6)
+ stfd %f22,112+8*8(%r6)
+ stfd %f23,112+9*8(%r6)
+ stfd %f24,112+10*8(%r6)
+ stfd %f25,112+11*8(%r6)
+ stfd %f26,112+12*8(%r6)
+ stfd %f27,112+13*8(%r6)
+ stfd %f28,112+14*8(%r6)
+ stfd %f29,112+15*8(%r6)
+ stfd %f30,112+16*8(%r6)
+ stfd %f31,112+17*8(%r6)
+
li %r3,0
blr
END(sigsetjmp)
ENTRY(siglongjmp)
lmw %r9,20(%r3)
+
+ /* FPRs */
+ lfd %f14,112+0*8(%r3)
+ lfd %f15,112+1*8(%r3)
+ lfd %f16,112+2*8(%r3)
+ lfd %f17,112+3*8(%r3)
+ lfd %f18,112+4*8(%r3)
+ lfd %f19,112+5*8(%r3)
+ lfd %f20,112+6*8(%r3)
+ lfd %f21,112+7*8(%r3)
+ lfd %f22,112+8*8(%r3)
+ lfd %f23,112+9*8(%r3)
+ lfd %f24,112+10*8(%r3)
+ lfd %f25,112+11*8(%r3)
+ lfd %f26,112+12*8(%r3)
+ lfd %f27,112+13*8(%r3)
+ lfd %f28,112+14*8(%r3)
+ lfd %f29,112+15*8(%r3)
+ lfd %f30,112+16*8(%r3)
+ lfd %f31,112+17*8(%r3)
+
lwz %r7,0(%r3)
mr %r6,%r4
mtlr %r11
diff --git a/lib/libc/powerpc/sys/Makefile.inc b/lib/libc/powerpc/sys/Makefile.inc
index ad98ba1b2934..98ec888e2222 100644
--- a/lib/libc/powerpc/sys/Makefile.inc
+++ b/lib/libc/powerpc/sys/Makefile.inc
@@ -6,6 +6,3 @@ MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o
PSEUDO= _getlogin.o _exit.o
-.if ${MK_SYSCALL_COMPAT} != "no"
-PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
-.endif
diff --git a/lib/libc/powerpc64/Makefile.inc b/lib/libc/powerpc64/Makefile.inc
index 2a080f62a614..8e9bcc52e7a0 100644
--- a/lib/libc/powerpc64/Makefile.inc
+++ b/lib/libc/powerpc64/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-SRCS+= __vdso_gettc.c
+SRCS+= trivial-vdso_tc.c
# Long double is 64-bits
MDSRCS+=machdep_ldisd.c
diff --git a/lib/libc/powerpc64/gen/Makefile.inc b/lib/libc/powerpc64/gen/Makefile.inc
index 79a274656e82..864fb9ede4f4 100644
--- a/lib/libc/powerpc64/gen/Makefile.inc
+++ b/lib/libc/powerpc64/gen/Makefile.inc
@@ -1,9 +1,10 @@
# $FreeBSD$
SRCS += _ctx_start.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \
- fpgetsticky.c fpsetmask.c fpsetround.c getcontextx.c \
+ fpgetsticky.c fpsetmask.c fpsetround.c \
infinity.c ldexp.c makecontext.c _setjmp.S \
setjmp.S sigsetjmp.S signalcontext.c syncicache.c \
- _set_tp.c
+ _set_tp.c \
+ trivial-getcontextx.c
diff --git a/lib/libc/powerpc64/gen/_set_tp.c b/lib/libc/powerpc64/gen/_set_tp.c
index 9adb6a5efec3..32137e505d00 100644
--- a/lib/libc/powerpc64/gen/_set_tp.c
+++ b/lib/libc/powerpc64/gen/_set_tp.c
@@ -29,7 +29,6 @@
void
_set_tp(void *tpval)
{
- register void *tp __asm__("r13");
- __asm __volatile("mr %0,%1" : "=r"(tp) : "r"((char*)tpval + 0x7010));
+ __asm __volatile("mr 13,%0" :: "r"((char*)tpval + 0x7010));
}
diff --git a/lib/libc/powerpc64/gen/_setjmp.S b/lib/libc/powerpc64/gen/_setjmp.S
index 207c4f7d10d9..f7689aeba350 100644
--- a/lib/libc/powerpc64/gen/_setjmp.S
+++ b/lib/libc/powerpc64/gen/_setjmp.S
@@ -56,23 +56,41 @@ ENTRY(_setjmp)
mr %r10,%r1
mr %r9,%r2
std %r9,40 + 0*8(%r3)
+ stfd %f14,40 + 23*8(%r3)
std %r10,40 + 1*8(%r3)
+ stfd %f15,40 + 24*8(%r3)
std %r11,40 + 2*8(%r3)
+ stfd %f16,40 + 25*8(%r3)
std %r12,40 + 3*8(%r3)
+ stfd %f17,40 + 26*8(%r3)
std %r13,40 + 4*8(%r3)
+ stfd %f18,40 + 27*8(%r3)
std %r14,40 + 5*8(%r3)
+ stfd %f19,40 + 28*8(%r3)
std %r15,40 + 6*8(%r3)
+ stfd %f20,40 + 29*8(%r3)
std %r16,40 + 7*8(%r3)
+ stfd %f21,40 + 30*8(%r3)
std %r17,40 + 8*8(%r3)
+ stfd %f22,40 + 31*8(%r3)
std %r18,40 + 9*8(%r3)
+ stfd %f23,40 + 32*8(%r3)
std %r19,40 + 10*8(%r3)
+ stfd %f24,40 + 33*8(%r3)
std %r20,40 + 11*8(%r3)
+ stfd %f25,40 + 34*8(%r3)
std %r21,40 + 12*8(%r3)
+ stfd %f26,40 + 35*8(%r3)
std %r22,40 + 13*8(%r3)
+ stfd %f27,40 + 36*8(%r3)
std %r23,40 + 14*8(%r3)
+ stfd %f28,40 + 37*8(%r3)
std %r24,40 + 15*8(%r3)
+ stfd %f29,40 + 38*8(%r3)
std %r25,40 + 16*8(%r3)
+ stfd %f30,40 + 39*8(%r3)
std %r26,40 + 17*8(%r3)
+ stfd %f31,40 + 40*8(%r3)
std %r27,40 + 18*8(%r3)
std %r28,40 + 19*8(%r3)
std %r29,40 + 20*8(%r3)
@@ -84,23 +102,41 @@ END(_setjmp)
ENTRY(_longjmp)
ld %r9,40 + 0*8(%r3)
+ lfd %f14,40 + 23*8(%r3)
ld %r10,40 + 1*8(%r3)
+ lfd %f15,40 + 24*8(%r3)
ld %r11,40 + 2*8(%r3)
+ lfd %f16,40 + 25*8(%r3)
ld %r12,40 + 3*8(%r3)
+ lfd %f17,40 + 26*8(%r3)
ld %r14,40 + 5*8(%r3)
+ lfd %f18,40 + 27*8(%r3)
ld %r15,40 + 6*8(%r3)
+ lfd %f19,40 + 28*8(%r3)
ld %r16,40 + 7*8(%r3)
+ lfd %f20,40 + 29*8(%r3)
ld %r17,40 + 8*8(%r3)
+ lfd %f21,40 + 30*8(%r3)
ld %r18,40 + 9*8(%r3)
+ lfd %f22,40 + 31*8(%r3)
ld %r19,40 + 10*8(%r3)
+ lfd %f23,40 + 32*8(%r3)
ld %r20,40 + 11*8(%r3)
+ lfd %f24,40 + 33*8(%r3)
ld %r21,40 + 12*8(%r3)
+ lfd %f25,40 + 34*8(%r3)
ld %r22,40 + 13*8(%r3)
+ lfd %f26,40 + 35*8(%r3)
ld %r23,40 + 14*8(%r3)
+ lfd %f27,40 + 36*8(%r3)
ld %r24,40 + 15*8(%r3)
+ lfd %f28,40 + 37*8(%r3)
ld %r25,40 + 16*8(%r3)
+ lfd %f29,40 + 38*8(%r3)
ld %r26,40 + 17*8(%r3)
+ lfd %f30,40 + 39*8(%r3)
ld %r27,40 + 18*8(%r3)
+ lfd %f31,40 + 40*8(%r3)
ld %r28,40 + 19*8(%r3)
ld %r29,40 + 20*8(%r3)
ld %r30,40 + 21*8(%r3)
diff --git a/lib/libc/powerpc64/gen/setjmp.S b/lib/libc/powerpc64/gen/setjmp.S
index 14954667b9b4..5eb395e7c30d 100644
--- a/lib/libc/powerpc64/gen/setjmp.S
+++ b/lib/libc/powerpc64/gen/setjmp.S
@@ -67,29 +67,49 @@ ENTRY(setjmp)
mr %r9,%r2 /* r9 <- global ptr */
std %r9,40 + 0*8(%r6)
+ stfd %f14,40 + 23*8(%r6)
std %r10,40 + 1*8(%r6)
+ stfd %f15,40 + 24*8(%r6)
std %r11,40 + 2*8(%r6)
+ stfd %f16,40 + 25*8(%r6)
std %r12,40 + 3*8(%r6)
+ stfd %f17,40 + 26*8(%r6)
std %r13,40 + 4*8(%r6)
+ stfd %f18,40 + 27*8(%r6)
std %r14,40 + 5*8(%r6)
+ stfd %f19,40 + 28*8(%r6)
std %r15,40 + 6*8(%r6)
+ stfd %f20,40 + 29*8(%r6)
std %r16,40 + 7*8(%r6)
+ stfd %f21,40 + 30*8(%r6)
std %r17,40 + 8*8(%r6)
+ stfd %f22,40 + 31*8(%r6)
std %r18,40 + 9*8(%r6)
+ stfd %f23,40 + 32*8(%r6)
std %r19,40 + 10*8(%r6)
+ stfd %f24,40 + 33*8(%r6)
std %r20,40 + 11*8(%r6)
+ stfd %f25,40 + 34*8(%r6)
std %r21,40 + 12*8(%r6)
+ stfd %f26,40 + 35*8(%r6)
std %r22,40 + 13*8(%r6)
+ stfd %f27,40 + 36*8(%r6)
std %r23,40 + 14*8(%r6)
+ stfd %f28,40 + 37*8(%r6)
std %r24,40 + 15*8(%r6)
+ stfd %f29,40 + 38*8(%r6)
std %r25,40 + 16*8(%r6)
+ stfd %f30,40 + 39*8(%r6)
std %r26,40 + 17*8(%r6)
+ stfd %f31,40 + 40*8(%r6)
std %r27,40 + 18*8(%r6)
std %r28,40 + 19*8(%r6)
std %r29,40 + 20*8(%r6)
std %r30,40 + 21*8(%r6)
std %r31,40 + 22*8(%r6)
+ /* XXX Altivec regs */
+
li %r3,0 /* return (0) */
blr
END(setjmp)
@@ -97,23 +117,41 @@ END(setjmp)
WEAK_REFERENCE(__longjmp, longjmp)
ENTRY(__longjmp)
ld %r9,40 + 0*8(%r3)
+ lfd %f14,40 + 23*8(%r3)
ld %r10,40 + 1*8(%r3)
+ lfd %f15,40 + 24*8(%r3)
ld %r11,40 + 2*8(%r3)
+ lfd %f16,40 + 25*8(%r3)
ld %r12,40 + 3*8(%r3)
+ lfd %f17,40 + 26*8(%r3)
ld %r14,40 + 5*8(%r3)
+ lfd %f18,40 + 27*8(%r3)
ld %r15,40 + 6*8(%r3)
+ lfd %f19,40 + 28*8(%r3)
ld %r16,40 + 7*8(%r3)
+ lfd %f20,40 + 29*8(%r3)
ld %r17,40 + 8*8(%r3)
+ lfd %f21,40 + 30*8(%r3)
ld %r18,40 + 9*8(%r3)
+ lfd %f22,40 + 31*8(%r3)
ld %r19,40 + 10*8(%r3)
+ lfd %f23,40 + 32*8(%r3)
ld %r20,40 + 11*8(%r3)
+ lfd %f24,40 + 33*8(%r3)
ld %r21,40 + 12*8(%r3)
+ lfd %f25,40 + 34*8(%r3)
ld %r22,40 + 13*8(%r3)
+ lfd %f26,40 + 35*8(%r3)
ld %r23,40 + 14*8(%r3)
+ lfd %f27,40 + 36*8(%r3)
ld %r24,40 + 15*8(%r3)
+ lfd %f28,40 + 37*8(%r3)
ld %r25,40 + 16*8(%r3)
+ lfd %f29,40 + 38*8(%r3)
ld %r26,40 + 17*8(%r3)
+ lfd %f30,40 + 39*8(%r3)
ld %r27,40 + 18*8(%r3)
+ lfd %f31,40 + 40*8(%r3)
ld %r28,40 + 19*8(%r3)
ld %r29,40 + 20*8(%r3)
ld %r30,40 + 21*8(%r3)
diff --git a/lib/libc/powerpc64/gen/sigsetjmp.S b/lib/libc/powerpc64/gen/sigsetjmp.S
index 5cfd684d38da..c0648a632f1e 100644
--- a/lib/libc/powerpc64/gen/sigsetjmp.S
+++ b/lib/libc/powerpc64/gen/sigsetjmp.S
@@ -72,23 +72,41 @@ ENTRY(sigsetjmp)
mr %r9,%r2
std %r9,40 + 0*8(%r6)
+ stfd %f14,40 + 23*8(%r6)
std %r10,40 + 1*8(%r6)
+ stfd %f15,40 + 24*8(%r6)
std %r11,40 + 2*8(%r6)
+ stfd %f16,40 + 25*8(%r6)
std %r12,40 + 3*8(%r6)
+ stfd %f17,40 + 26*8(%r6)
std %r13,40 + 4*8(%r6)
+ stfd %f18,40 + 27*8(%r6)
std %r14,40 + 5*8(%r6)
+ stfd %f19,40 + 28*8(%r6)
std %r15,40 + 6*8(%r6)
+ stfd %f20,40 + 29*8(%r6)
std %r16,40 + 7*8(%r6)
+ stfd %f21,40 + 30*8(%r6)
std %r17,40 + 8*8(%r6)
+ stfd %f22,40 + 31*8(%r6)
std %r18,40 + 9*8(%r6)
+ stfd %f23,40 + 32*8(%r6)
std %r19,40 + 10*8(%r6)
+ stfd %f24,40 + 33*8(%r6)
std %r20,40 + 11*8(%r6)
+ stfd %f25,40 + 34*8(%r6)
std %r21,40 + 12*8(%r6)
+ stfd %f26,40 + 35*8(%r6)
std %r22,40 + 13*8(%r6)
+ stfd %f27,40 + 36*8(%r6)
std %r23,40 + 14*8(%r6)
+ stfd %f28,40 + 37*8(%r6)
std %r24,40 + 15*8(%r6)
+ stfd %f29,40 + 38*8(%r6)
std %r25,40 + 16*8(%r6)
+ stfd %f30,40 + 39*8(%r6)
std %r26,40 + 17*8(%r6)
+ stfd %f31,40 + 40*8(%r6)
std %r27,40 + 18*8(%r6)
std %r28,40 + 19*8(%r6)
std %r29,40 + 20*8(%r6)
@@ -101,23 +119,41 @@ END(sigsetjmp)
ENTRY(siglongjmp)
ld %r9,40 + 0*8(%r3)
+ lfd %f14,40 + 23*8(%r3)
ld %r10,40 + 1*8(%r3)
+ lfd %f15,40 + 24*8(%r3)
ld %r11,40 + 2*8(%r3)
+ lfd %f16,40 + 25*8(%r3)
ld %r12,40 + 3*8(%r3)
+ lfd %f17,40 + 26*8(%r3)
ld %r14,40 + 5*8(%r3)
+ lfd %f18,40 + 27*8(%r3)
ld %r15,40 + 6*8(%r3)
+ lfd %f19,40 + 28*8(%r3)
ld %r16,40 + 7*8(%r3)
+ lfd %f20,40 + 29*8(%r3)
ld %r17,40 + 8*8(%r3)
+ lfd %f21,40 + 30*8(%r3)
ld %r18,40 + 9*8(%r3)
+ lfd %f22,40 + 31*8(%r3)
ld %r19,40 + 10*8(%r3)
+ lfd %f23,40 + 32*8(%r3)
ld %r20,40 + 11*8(%r3)
+ lfd %f24,40 + 33*8(%r3)
ld %r21,40 + 12*8(%r3)
+ lfd %f25,40 + 34*8(%r3)
ld %r22,40 + 13*8(%r3)
+ lfd %f26,40 + 35*8(%r3)
ld %r23,40 + 14*8(%r3)
+ lfd %f27,40 + 36*8(%r3)
ld %r24,40 + 15*8(%r3)
+ lfd %f28,40 + 37*8(%r3)
ld %r25,40 + 16*8(%r3)
+ lfd %f29,40 + 38*8(%r3)
ld %r26,40 + 17*8(%r3)
+ lfd %f30,40 + 39*8(%r3)
ld %r27,40 + 18*8(%r3)
+ lfd %f31,40 + 40*8(%r3)
ld %r28,40 + 19*8(%r3)
ld %r29,40 + 20*8(%r3)
ld %r30,40 + 21*8(%r3)
diff --git a/lib/libc/powerpc64/sys/Makefile.inc b/lib/libc/powerpc64/sys/Makefile.inc
index ad98ba1b2934..98ec888e2222 100644
--- a/lib/libc/powerpc64/sys/Makefile.inc
+++ b/lib/libc/powerpc64/sys/Makefile.inc
@@ -6,6 +6,3 @@ MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o
PSEUDO= _getlogin.o _exit.o
-.if ${MK_SYSCALL_COMPAT} != "no"
-PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
-.endif
diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c
index 589bb9d72698..436370d0f6af 100644
--- a/lib/libc/regex/engine.c
+++ b/lib/libc/regex/engine.c
@@ -157,7 +157,7 @@ matcher(struct re_guts *g,
int i;
struct match mv;
struct match *m = &mv;
- const char *dp;
+ const char *dp = NULL;
const sopno gf = g->firststate+1; /* +1 for OEND */
const sopno gl = g->laststate;
const char *start;
@@ -244,7 +244,7 @@ matcher(struct re_guts *g,
ZAPSTATE(&m->mbs);
/* Adjust start according to moffset, to speed things up */
- if (g->moffset > -1)
+ if (dp != NULL && g->moffset > -1)
start = ((dp - g->moffset) < start) ? start : dp - g->moffset;
SP("mloop", m->st, *start);
diff --git a/lib/libc/regex/re_format.7 b/lib/libc/regex/re_format.7
index 05b14947e45f..b3f95611c9f8 100644
--- a/lib/libc/regex/re_format.7
+++ b/lib/libc/regex/re_format.7
@@ -314,10 +314,10 @@ compatible with but not specified by
.St -p1003.2 ,
and should be used with
caution in software intended to be portable to other systems.
-The additional word delimiters
+The additional word delimiters
.Ql \e<
and
-.Ql \e>
+.Ql \e>
are provided to ease compatibility with traditional
.Xr svr4 4
systems but are not portable and should be avoided.
@@ -392,10 +392,12 @@ and
.Ql ?\&
are ordinary characters, and their functionality
can be expressed using bounds
-.No ( Ql {1,}
+.Po
+.Ql {1,}
or
.Ql {0,1}
-respectively).
+respectively
+.Pc .
Also note that
.Ql x+
in modern REs is equivalent to
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index a01bb95931bf..2f2d827ba836 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -192,6 +192,7 @@ regcomp(regex_t * __restrict preg,
struct parse *p = &pa;
int i;
size_t len;
+ size_t maxlen;
#ifdef REDEBUG
# define GOODFLAGS(f) (f)
#else
@@ -213,7 +214,23 @@ regcomp(regex_t * __restrict preg,
g = (struct re_guts *)malloc(sizeof(struct re_guts));
if (g == NULL)
return(REG_ESPACE);
+ /*
+ * Limit the pattern space to avoid a 32-bit overflow on buffer
+ * extension. Also avoid any signed overflow in case of conversion
+ * so make the real limit based on a 31-bit overflow.
+ *
+ * Likely not applicable on 64-bit systems but handle the case
+ * generically (who are we to stop people from using ~715MB+
+ * patterns?).
+ */
+ maxlen = ((size_t)-1 >> 1) / sizeof(sop) * 2 / 3;
+ if (len >= maxlen) {
+ free((char *)g);
+ return(REG_ESPACE);
+ }
p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */
+ assert(p->ssize >= len);
+
p->strip = (sop *)malloc(p->ssize * sizeof(sop));
p->slen = 0;
if (p->strip == NULL) {
@@ -1405,8 +1422,8 @@ static void
findmust(struct parse *p, struct re_guts *g)
{
sop *scan;
- sop *start;
- sop *newstart;
+ sop *start = NULL;
+ sop *newstart = NULL;
sopno newlen;
sop s;
char *cp;
@@ -1709,15 +1726,17 @@ computematchjumps(struct parse *p, struct re_guts *g)
if (p->error != 0)
return;
- pmatches = (int*) malloc(g->mlen * sizeof(unsigned int));
+ pmatches = (int*) malloc(g->mlen * sizeof(int));
if (pmatches == NULL) {
g->matchjump = NULL;
return;
}
- g->matchjump = (int*) malloc(g->mlen * sizeof(unsigned int));
- if (g->matchjump == NULL) /* Not a fatal error */
+ g->matchjump = (int*) malloc(g->mlen * sizeof(int));
+ if (g->matchjump == NULL) { /* Not a fatal error */
+ free(pmatches);
return;
+ }
/* Set maximum possible jump for each character in the pattern */
for (mindex = 0; mindex < g->mlen; mindex++)
diff --git a/lib/libc/regex/regex.3 b/lib/libc/regex/regex.3
index ea1ba25a90b4..6df2f0981f56 100644
--- a/lib/libc/regex/regex.3
+++ b/lib/libc/regex/regex.3
@@ -420,10 +420,12 @@ it should have been the result from the most recent
using that
.Ft regex_t .
The
-.Fn ( regerror
+.Po
+.Fn regerror
may be able to supply a more detailed message using information
from the
-.Ft regex_t . )
+.Ft regex_t .
+.Pc
The
.Fn regerror
function
diff --git a/lib/libc/rpc/clnt_dg.c b/lib/libc/rpc/clnt_dg.c
index 5feab889154f..cebbaf9e344f 100644
--- a/lib/libc/rpc/clnt_dg.c
+++ b/lib/libc/rpc/clnt_dg.c
@@ -327,7 +327,7 @@ clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
struct sockaddr *sa;
sigset_t mask;
sigset_t newmask;
- socklen_t inlen, salen;
+ socklen_t salen;
ssize_t recvlen = 0;
int kin_len, n, rpc_lock_value;
u_int32_t xid;
@@ -520,7 +520,6 @@ get_reply:
goto call_again_same_xid;
}
}
- inlen = (socklen_t)recvlen;
/*
* now decode and validate the response
diff --git a/lib/libc/rpc/crypt_client.c b/lib/libc/rpc/crypt_client.c
index 4e5c7932e7a1..5290021a3341 100644
--- a/lib/libc/rpc/crypt_client.c
+++ b/lib/libc/rpc/crypt_client.c
@@ -64,6 +64,7 @@ _des_crypt_call(buf, len, dparms)
}
if (nconf == NULL) {
warnx("getnetconfig: %s", nc_sperror());
+ endnetconfig(localhandle);
return(DESERR_HWERROR);
}
clnt = clnt_tp_create(NULL, CRYPT_PROG, CRYPT_VERS, nconf);
diff --git a/lib/libc/rpc/rpc.3 b/lib/libc/rpc/rpc.3
index 4fa3e2cee58f..988b5f1ec233 100644
--- a/lib/libc/rpc/rpc.3
+++ b/lib/libc/rpc/rpc.3
@@ -504,7 +504,6 @@ pages on which they are described:
.Sh SEE ALSO
.Xr getnetconfig 3 ,
.Xr getnetpath 3 ,
-.Xr rpcbind 3 ,
.Xr rpc_clnt_auth 3 ,
.Xr rpc_clnt_calls 3 ,
.Xr rpc_clnt_create 3 ,
@@ -513,5 +512,6 @@ pages on which they are described:
.Xr rpc_svc_err 3 ,
.Xr rpc_svc_reg 3 ,
.Xr rpc_xdr 3 ,
+.Xr rpcbind 3 ,
.Xr xdr 3 ,
.Xr netconfig 5
diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c
index d7702f5913be..febc597c5d94 100644
--- a/lib/libc/rpc/rpc_soc.c
+++ b/lib/libc/rpc/rpc_soc.c
@@ -462,12 +462,10 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
u_int recvsz;
{
struct netbuf *svcaddr;
- struct netconfig *nconf;
CLIENT *cl;
int len;
cl = NULL;
- nconf = NULL;
svcaddr = NULL;
if ((raddr->sun_len == 0) ||
((svcaddr = malloc(sizeof(struct netbuf))) == NULL ) ||
diff --git a/lib/libc/rpc/rpc_svc_reg.3 b/lib/libc/rpc/rpc_svc_reg.3
index aed2ba127a16..81a749a107e4 100644
--- a/lib/libc/rpc/rpc_svc_reg.3
+++ b/lib/libc/rpc/rpc_svc_reg.3
@@ -176,8 +176,8 @@ Service implementors usually do not need this routine.
.Sh SEE ALSO
.Xr select 2 ,
.Xr rpc 3 ,
-.Xr rpcbind 3 ,
.Xr rpc_svc_calls 3 ,
.Xr rpc_svc_create 3 ,
.Xr rpc_svc_err 3 ,
+.Xr rpcbind 3 ,
.Xr rpcbind 8
diff --git a/lib/libc/rpc/rpcbind.3 b/lib/libc/rpc/rpcbind.3
index 0b716ca7a2b6..3bf8be9ffa90 100644
--- a/lib/libc/rpc/rpcbind.3
+++ b/lib/libc/rpc/rpcbind.3
@@ -25,7 +25,7 @@
.Ft bool_t
.Fn rpcb_gettime "const char *host" "time_t * timep"
.Ft "enum clnt_stat"
-.Fn rpcb_rmtcall "const struct netconfig *netconf" "const char *host" "const rpcprog_t prognum, const rpcvers_t versnum" "const rpcproc_t procnum, const xdrproc_t inproc" "const caddr_t in" "const xdrproc_t outproc" "const caddr_t out" "const struct timeval tout, const struct netbuf *svcaddr"
+.Fn rpcb_rmtcall "const struct netconfig *netconf" "const char *host" "const rpcprog_t prognum" "const rpcvers_t versnum" "const rpcproc_t procnum" "const xdrproc_t inproc" "const caddr_t in" "const xdrproc_t outproc" "const caddr_t out" "const struct timeval tout" "const struct netbuf *svcaddr"
.Ft bool_t
.Fn rpcb_set "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" "const struct netbuf *svcaddr"
.Ft bool_t
diff --git a/lib/libc/rpc/svc_vc.c b/lib/libc/rpc/svc_vc.c
index f8304256000a..aa4539666789 100644
--- a/lib/libc/rpc/svc_vc.c
+++ b/lib/libc/rpc/svc_vc.c
@@ -128,7 +128,7 @@ svc_vc_create(fd, sendsize, recvsize)
u_int sendsize;
u_int recvsize;
{
- SVCXPRT *xprt;
+ SVCXPRT *xprt = NULL;
struct cf_rendezvous *r = NULL;
struct __rpc_sockinfo si;
struct sockaddr_storage sslocal;
diff --git a/lib/libc/sparc64/Makefile.inc b/lib/libc/sparc64/Makefile.inc
index af23ae4f4cf3..74fb7cd05911 100644
--- a/lib/libc/sparc64/Makefile.inc
+++ b/lib/libc/sparc64/Makefile.inc
@@ -5,7 +5,7 @@
.include "fpu/Makefile.inc"
-SRCS+= __vdso_gettc.c
+SRCS+= trivial-vdso_tc.c
# Long double is quad precision
GDTOASRCS+=strtorQ.c
diff --git a/lib/libc/sparc64/gen/Makefile.inc b/lib/libc/sparc64/gen/Makefile.inc
index d3fbfe4e2acf..5442a33fdb18 100644
--- a/lib/libc/sparc64/gen/Makefile.inc
+++ b/lib/libc/sparc64/gen/Makefile.inc
@@ -2,5 +2,6 @@
SRCS+= _ctx_start.S _setjmp.S fabs.S fixunsdfsi.S flt_rounds.c fpgetmask.c \
fpgetround.c fpgetsticky.c fpsetmask.c fpsetround.c \
- getcontextx.c infinity.c ldexp.c makecontext.c \
- signalcontext.c setjmp.S sigsetjmp.S _set_tp.c
+ infinity.c ldexp.c makecontext.c \
+ signalcontext.c setjmp.S sigsetjmp.S _set_tp.c \
+ trivial-getcontextx.c
diff --git a/lib/libc/sparc64/gen/getcontextx.c b/lib/libc/sparc64/gen/getcontextx.c
deleted file mode 100644
index 54f851384811..000000000000
--- a/lib/libc/sparc64/gen/getcontextx.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2011 Konstantin Belousov <kib@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/ucontext.h>
-#include <errno.h>
-#include <stdlib.h>
-
-int
-__getcontextx_size(void)
-{
-
- return (sizeof(ucontext_t));
-}
-
-int
-__fillcontextx2(char *ctx)
-{
-
- return (0);
-}
-
-int
-__fillcontextx(char *ctx)
-{
- ucontext_t *ucp;
-
- ucp = (ucontext_t *)ctx;
- return (getcontext(ucp));
-}
-
-__weak_reference(__getcontextx, getcontextx);
-
-ucontext_t *
-__getcontextx(void)
-{
- char *ctx;
- int error;
-
- ctx = malloc(__getcontextx_size());
- if (ctx == NULL)
- return (NULL);
- if (__fillcontextx(ctx) == -1) {
- error = errno;
- free(ctx);
- errno = error;
- return (NULL);
- }
- return ((ucontext_t *)ctx);
-}
diff --git a/lib/libc/sparc64/sys/Makefile.inc b/lib/libc/sparc64/sys/Makefile.inc
index 031af1965228..a62aac2061d9 100644
--- a/lib/libc/sparc64/sys/Makefile.inc
+++ b/lib/libc/sparc64/sys/Makefile.inc
@@ -12,12 +12,9 @@ SRCS+= __sparc_sigtramp_setup.c \
CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu
-MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction.S
+MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction1.S
# Don't generate default code for these syscalls:
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o
PSEUDO= _getlogin.o _exit.o
-.if ${MK_SYSCALL_COMPAT} != "no"
-PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o
-.endif
diff --git a/lib/libc/sparc64/sys/__vdso_gettc.c b/lib/libc/sparc64/sys/__vdso_gettc.c
deleted file mode 100644
index b99bbc4f3d0f..000000000000
--- a/lib/libc/sparc64/sys/__vdso_gettc.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/vdso.h>
-#include <errno.h>
-
-#pragma weak __vdso_gettc
-u_int
-__vdso_gettc(const struct vdso_timehands *th)
-{
-
- return (0);
-}
-
-#pragma weak __vdso_gettimekeep
-int
-__vdso_gettimekeep(struct vdso_timekeep **tk)
-{
-
- return (ENOSYS);
-}
diff --git a/lib/libc/sparc64/sys/sigaction.S b/lib/libc/sparc64/sys/sigaction1.S
index 7d32f975af20..219a238cdb2a 100644
--- a/lib/libc/sparc64/sys/sigaction.S
+++ b/lib/libc/sparc64/sys/sigaction1.S
@@ -29,7 +29,8 @@ __FBSDID("$FreeBSD$");
#include "SYS.h"
-_SYSENTRY(sigaction)
+ WEAK_REFERENCE(__sys_sigaction, _sigaction)
+ENTRY(__sys_sigaction)
PIC_PROLOGUE(%o3, %o4)
SET(sigcode_installed, %o4, %o3)
lduw [%o3], %o4
@@ -44,6 +45,6 @@ _SYSENTRY(sigaction)
1: _SYSCALL(sigaction)
retl
nop
-_SYSEND(sigaction)
+END(__sys_sigaction)
.comm sigcode_installed, 4, 4
diff --git a/lib/libc/stdio/fflush.c b/lib/libc/stdio/fflush.c
index ef9b45b8b6f1..123167a09129 100644
--- a/lib/libc/stdio/fflush.c
+++ b/lib/libc/stdio/fflush.c
@@ -124,11 +124,13 @@ __sflush(FILE *fp)
t = _swrite(fp, (char *)p, n);
if (t <= 0) {
/* Reset _p and _w. */
- if (p > fp->_p) /* Some was written. */
+ if (p > fp->_p) {
+ /* Some was written. */
memmove(fp->_p, p, n);
- fp->_p += n;
- if ((fp->_flags & (__SLBF | __SNBF)) == 0)
- fp->_w -= n;
+ fp->_p += n;
+ if ((fp->_flags & (__SLBF | __SNBF)) == 0)
+ fp->_w -= n;
+ }
fp->_flags |= __SERR;
return (EOF);
}
diff --git a/lib/libc/stdio/flags.c b/lib/libc/stdio/flags.c
index b7552a43804c..9eed6d7dc8c7 100644
--- a/lib/libc/stdio/flags.c
+++ b/lib/libc/stdio/flags.c
@@ -97,6 +97,10 @@ __sflags(const char *mode, int *optr)
/* set close-on-exec */
o |= O_CLOEXEC;
break;
+ case 'v':
+ /* verify */
+ o |= O_VERIFY;
+ break;
default:
known = 0;
break;
diff --git a/lib/libc/stdio/open_memstream.3 b/lib/libc/stdio/open_memstream.3
index 117dcb270ee6..e01952bc4941 100644
--- a/lib/libc/stdio/open_memstream.3
+++ b/lib/libc/stdio/open_memstream.3
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2013 Advanced Computing Technologies LLC
+.\" Copyright (c) 2013 Hudson River Trading LLC
.\" Written by: John H. Baldwin <jhb@FreeBSD.org>
.\" All rights reserved.
.\"
diff --git a/lib/libc/stdio/open_memstream.c b/lib/libc/stdio/open_memstream.c
index aa50822b1522..baa71e4a72ef 100644
--- a/lib/libc/stdio/open_memstream.c
+++ b/lib/libc/stdio/open_memstream.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2013 Advanced Computing Technologies LLC
+ * Copyright (c) 2013 Hudson River Trading LLC
* Written by: John H. Baldwin <jhb@FreeBSD.org>
* All rights reserved.
*
diff --git a/lib/libc/stdio/open_wmemstream.c b/lib/libc/stdio/open_wmemstream.c
index cf2968ae626f..299e3d87940f 100644
--- a/lib/libc/stdio/open_wmemstream.c
+++ b/lib/libc/stdio/open_wmemstream.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2013 Advanced Computing Technologies LLC
+ * Copyright (c) 2013 Hudson River Trading LLC
* Written by: John H. Baldwin <jhb@FreeBSD.org>
* All rights reserved.
*
diff --git a/lib/libc/stdio/xprintf_float.c b/lib/libc/stdio/xprintf_float.c
index b719aacc2fbd..ad17eb272032 100644
--- a/lib/libc/stdio/xprintf_float.c
+++ b/lib/libc/stdio/xprintf_float.c
@@ -168,7 +168,6 @@ __printf_render_float(struct __printf_io *io, const struct printf_info *pi, cons
int realsz; /* field size expanded by dprec, sign, etc */
int dprec; /* a copy of prec if [diouxX], 0 otherwise */
char ox[2]; /* space for 0x; ox[1] is either x, X, or \0 */
- int prsize; /* max size of printed field */
int ret; /* return value accumulator */
char *decimal_point; /* locale specific decimal point */
int n2; /* XXX: for PRINTANDPAD */
@@ -344,8 +343,6 @@ here:
if (ox[1])
realsz += 2;
- prsize = pi->width > realsz ? pi->width : realsz;
-
/* right-adjusting blank padding */
if (pi->pad != '0' && pi->left == 0)
ret += __printf_pad(io, pi->width - realsz, 0);
diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc
index 57205a756a97..7cee03af8df8 100644
--- a/lib/libc/stdlib/Makefile.inc
+++ b/lib/libc/stdlib/Makefile.inc
@@ -10,7 +10,8 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \
insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \
merge.c mergesort_b.c ptsname.c qsort.c qsort_r.c quick_exit.c \
radixsort.c rand.c \
- random.c reallocf.c realpath.c remque.c strfmon.c strtoimax.c \
+ random.c reallocarray.c reallocf.c realpath.c remque.c strfmon.c \
+ strtoimax.c \
strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \
strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c
@@ -25,7 +26,7 @@ MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 \
hcreate.3 imaxabs.3 imaxdiv.3 insque.3 labs.3 ldiv.3 llabs.3 lldiv.3 \
lsearch.3 memory.3 ptsname.3 qsort.3 \
quick_exit.3 \
- radixsort.3 rand.3 random.3 reallocf.3 \
+ radixsort.3 rand.3 random.3 reallocarray.3 reallocf.3 \
realpath.3 strfmon.3 strtod.3 strtol.3 strtonum.3 strtoul.3 system.3 \
tsearch.3
diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map
index 8355f9a0f8d8..782023e022ee 100644
--- a/lib/libc/stdlib/Symbol.map
+++ b/lib/libc/stdlib/Symbol.map
@@ -113,9 +113,11 @@ FBSD_1.4 {
hcreate_r;
hdestroy_r;
hsearch_r;
+ reallocarray;
};
FBSDprivate_1.0 {
__system;
_system;
+ __libc_system;
};
diff --git a/lib/libc/stdlib/atexit.3 b/lib/libc/stdlib/atexit.3
index 68f4e8fb1dcf..3cdc59fed862 100644
--- a/lib/libc/stdlib/atexit.3
+++ b/lib/libc/stdlib/atexit.3
@@ -88,12 +88,12 @@ The existing list of functions is unmodified.
.It Bq Er ENOSYS
The
.Fn atexit_b
-function was called by a program that did not supply a
+function was called by a program that did not supply a
.Fn _Block_copy
implementation.
.El
.Sh SEE ALSO
-.Xr at_quick_exit 3
+.Xr at_quick_exit 3 ,
.Xr exit 3
.Sh STANDARDS
The
diff --git a/lib/libc/stdlib/exit.3 b/lib/libc/stdlib/exit.3
index 07ce0d77d106..7d657c922ce9 100644
--- a/lib/libc/stdlib/exit.3
+++ b/lib/libc/stdlib/exit.3
@@ -117,8 +117,8 @@ never return.
.Sh SEE ALSO
.Xr _exit 2 ,
.Xr wait 2 ,
-.Xr atexit 3 ,
.Xr at_quick_exit 3 ,
+.Xr atexit 3 ,
.Xr intro 3 ,
.Xr quick_exit 3 ,
.Xr sysexits 3 ,
diff --git a/lib/libc/stdlib/jemalloc/Symbol.map b/lib/libc/stdlib/jemalloc/Symbol.map
index 35a5dad8995e..132664a7bd69 100644
--- a/lib/libc/stdlib/jemalloc/Symbol.map
+++ b/lib/libc/stdlib/jemalloc/Symbol.map
@@ -55,4 +55,5 @@ FBSDprivate_1.0 {
_malloc_thread_cleanup;
_malloc_prefork;
_malloc_postfork;
+ _malloc_first_thread;
};
diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c
index 93e22cdf9315..e97ea9272dd6 100644
--- a/lib/libc/stdlib/qsort.c
+++ b/lib/libc/stdlib/qsort.c
@@ -41,47 +41,55 @@ typedef int cmp_t(void *, const void *, const void *);
typedef int cmp_t(const void *, const void *);
#endif
static inline char *med3(char *, char *, char *, cmp_t *, void *);
-static inline void swapfunc(char *, char *, int, int);
+static inline void swapfunc(char *, char *, int, int, int);
-#define min(a, b) (a) < (b) ? a : b
+#define MIN(a, b) ((a) < (b) ? a : b)
/*
* Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
*/
-#define swapcode(TYPE, parmi, parmj, n) { \
- long i = (n) / sizeof (TYPE); \
- TYPE *pi = (TYPE *) (parmi); \
- TYPE *pj = (TYPE *) (parmj); \
+#define swapcode(TYPE, parmi, parmj, n) { \
+ long i = (n) / sizeof (TYPE); \
+ TYPE *pi = (TYPE *) (parmi); \
+ TYPE *pj = (TYPE *) (parmj); \
do { \
TYPE t = *pi; \
*pi++ = *pj; \
*pj++ = t; \
- } while (--i > 0); \
+ } while (--i > 0); \
}
-#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
- es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
+#define SWAPINIT(TYPE, a, es) swaptype_ ## TYPE = \
+ ((char *)a - (char *)0) % sizeof(TYPE) || \
+ es % sizeof(TYPE) ? 2 : es == sizeof(TYPE) ? 0 : 1;
static inline void
-swapfunc(a, b, n, swaptype)
+swapfunc(a, b, n, swaptype_long, swaptype_int)
char *a, *b;
- int n, swaptype;
+ int n, swaptype_long, swaptype_int;
{
- if(swaptype <= 1)
+ if (swaptype_long <= 1)
swapcode(long, a, b, n)
+ else if (swaptype_int <= 1)
+ swapcode(int, a, b, n)
else
swapcode(char, a, b, n)
}
-#define swap(a, b) \
- if (swaptype == 0) { \
+#define swap(a, b) \
+ if (swaptype_long == 0) { \
long t = *(long *)(a); \
*(long *)(a) = *(long *)(b); \
*(long *)(b) = t; \
+ } else if (swaptype_int == 0) { \
+ int t = *(int *)(a); \
+ *(int *)(a) = *(int *)(b); \
+ *(int *)(b) = t; \
} else \
- swapfunc(a, b, es, swaptype)
+ swapfunc(a, b, es, swaptype_long, swaptype_int)
-#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype)
+#define vecswap(a, b, n) \
+ if ((n) > 0) swapfunc(a, b, n, swaptype_long, swaptype_int)
#ifdef I_AM_QSORT_R
#define CMP(t, x, y) (cmp((t), (x), (y)))
@@ -98,14 +106,14 @@ __unused
{
return CMP(thunk, a, b) < 0 ?
(CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a ))
- :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
+ :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
}
#ifdef I_AM_QSORT_R
void
qsort_r(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp)
#else
-#define thunk NULL
+#define thunk NULL
void
qsort(void *a, size_t n, size_t es, cmp_t *cmp)
#endif
@@ -113,9 +121,10 @@ qsort(void *a, size_t n, size_t es, cmp_t *cmp)
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
size_t d, r;
int cmp_result;
- int swaptype, swap_cnt;
+ int swaptype_long, swaptype_int, swap_cnt;
-loop: SWAPINIT(a, es);
+loop: SWAPINIT(long, a, es);
+ SWAPINIT(int, a, es);
swap_cnt = 0;
if (n < 7) {
for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
@@ -175,9 +184,9 @@ loop: SWAPINIT(a, es);
}
pn = (char *)a + n * es;
- r = min(pa - (char *)a, pb - pa);
+ r = MIN(pa - (char *)a, pb - pa);
vecswap(a, pb - r, r);
- r = min(pd - pc, pn - pd - es);
+ r = MIN(pd - pc, pn - pd - es);
vecswap(pb, pn - r, r);
if ((r = pb - pa) > es)
#ifdef I_AM_QSORT_R
diff --git a/lib/libc/stdlib/quick_exit.3 b/lib/libc/stdlib/quick_exit.3
index f2ea379c91d1..7bbd2f3d53b7 100644
--- a/lib/libc/stdlib/quick_exit.3
+++ b/lib/libc/stdlib/quick_exit.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 7, 2011
+.Dd December 13, 2014
.Dt QUICK_EXIT 3
.Os
.Sh NAME
@@ -35,7 +35,7 @@
.Sh SYNOPSIS
.In stdlib.h
.Ft _Noreturn void
-.Fn quick_exit "void"
+.Fn quick_exit "int status"
.Sh DESCRIPTION
The
.Fn quick_exit
diff --git a/lib/libc/stdlib/random.3 b/lib/libc/stdlib/random.3
index dc8e961d8cec..254be0a3a07f 100644
--- a/lib/libc/stdlib/random.3
+++ b/lib/libc/stdlib/random.3
@@ -54,9 +54,8 @@
.Fn setstate "char *state"
.Sh DESCRIPTION
.Bf -symbolic
-The functions described in this manual page are not cryptographically
-secure.
-Cryptographic applications should use
+The functions described in this manual page are not secure.
+Applications which require unpredictable random numbers should use
.Xr arc4random 3
instead.
.Ef
diff --git a/lib/libc/stdlib/reallocarray.3 b/lib/libc/stdlib/reallocarray.3
new file mode 100644
index 000000000000..8e714f4daecc
--- /dev/null
+++ b/lib/libc/stdlib/reallocarray.3
@@ -0,0 +1,142 @@
+.\" Copyright (c) 1980, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" the American National Standards Committee X3, on Information
+.\" Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 1, 2015
+.Dt REALLOCARRAY 3
+.Os
+.Sh NAME
+.Nm reallocarray
+.Nd memory reallocation function
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In stdlib.h
+.Ft void *
+.Fn reallocarray "void *ptr" "size_t nmemb" "size_t size"
+.Sh DESCRIPTION
+The
+.Fn reallocarray
+function is similar to the
+.Fn realloc
+function
+except it operates on
+.Fa nmemb
+members of size
+.Fa size
+and checks for integer overflow in the calculation
+.Fa nmemb
+*
+.Fa size .
+.Sh RETURN VALUES
+The
+.Fn reallocarray
+function returns a pointer to the allocated space; otherwise, a
+.Dv NULL
+pointer is returned and
+.Va errno
+is set to
+.Er ENOMEM .
+.Sh EXAMPLES
+Consider
+.Fn reallocarray
+when there is multiplication in the
+.Fa size
+argument of
+.Fn malloc
+or
+.Fn realloc .
+For example, avoid this common idiom as it may lead to integer overflow:
+.Bd -literal -offset indent
+if ((p = malloc(num * size)) == NULL)
+ err(1, "malloc");
+.Ed
+.Pp
+A drop-in replacement is the
+.Ox
+extension
+.Fn reallocarray :
+.Bd -literal -offset indent
+if ((p = reallocarray(NULL, num, size)) == NULL)
+ err(1, "reallocarray");
+.Ed
+.Pp
+When using
+.Fn realloc ,
+be careful to avoid the following idiom:
+.Bd -literal -offset indent
+size += 50;
+if ((p = realloc(p, size)) == NULL)
+ return (NULL);
+.Ed
+.Pp
+Do not adjust the variable describing how much memory has been allocated
+until the allocation has been successful.
+This can cause aberrant program behavior if the incorrect size value is used.
+In most cases, the above sample will also result in a leak of memory.
+As stated earlier, a return value of
+.Dv NULL
+indicates that the old object still remains allocated.
+Better code looks like this:
+.Bd -literal -offset indent
+newsize = size + 50;
+if ((newp = realloc(p, newsize)) == NULL) {
+ free(p);
+ p = NULL;
+ size = 0;
+ return (NULL);
+}
+p = newp;
+size = newsize;
+.Ed
+.Pp
+As with
+.Fn malloc ,
+it is important to ensure the new size value will not overflow;
+i.e. avoid allocations like the following:
+.Bd -literal -offset indent
+if ((newp = realloc(p, num * size)) == NULL) {
+ ...
+.Ed
+.Pp
+Instead, use
+.Fn reallocarray :
+.Bd -literal -offset indent
+if ((newp = reallocarray(p, num, size)) == NULL) {
+ ...
+.Ed
+.Sh SEE ALSO
+.Xr realloc 3
+.Sh HISTORY
+The
+.Fn reallocarray
+function first appeared in
+.Ox 5.6
+and
+.Fx 11.0 .
diff --git a/lib/libc/stdlib/reallocarray.c b/lib/libc/stdlib/reallocarray.c
new file mode 100644
index 000000000000..e1e9b7c16fff
--- /dev/null
+++ b/lib/libc/stdlib/reallocarray.c
@@ -0,0 +1,42 @@
+/* $OpenBSD: reallocarray.c,v 1.2 2014/12/08 03:45:00 bcook Exp $ */
+/*
+ * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+/*
+ * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
+ * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
+ */
+#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
+
+void *
+reallocarray(void *optr, size_t nmemb, size_t size)
+{
+
+ if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
+ nmemb > 0 && SIZE_MAX / nmemb < size) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ return (realloc(optr, size * nmemb));
+}
diff --git a/lib/libc/stdlib/system.c b/lib/libc/stdlib/system.c
index e018e6ff0b72..bd9ea5a30fdc 100644
--- a/lib/libc/stdlib/system.c
+++ b/lib/libc/stdlib/system.c
@@ -46,8 +46,17 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
#include "libc_private.h"
+#pragma weak system
int
-__system(const char *command)
+system(const char *command)
+{
+
+ return (((int (*)(const char *))
+ __libc_interposing[INTERPOS_system])(command));
+}
+
+int
+__libc_system(const char *command)
{
pid_t pid, savedpid;
int pstat;
@@ -95,5 +104,5 @@ __system(const char *command)
return(pid == -1 ? -1 : pstat);
}
-__weak_reference(__system, system);
-__weak_reference(__system, _system);
+__weak_reference(__libc_system, __system);
+__weak_reference(__libc_system, _system);
diff --git a/lib/libc/stdlib/tdelete.c b/lib/libc/stdlib/tdelete.c
index c83afb8cf3f1..bef187e81a2d 100644
--- a/lib/libc/stdlib/tdelete.c
+++ b/lib/libc/stdlib/tdelete.c
@@ -14,7 +14,7 @@
#include <sys/cdefs.h>
#if 0
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: tdelete.c,v 1.2 1999/09/16 11:45:37 lukem Exp $");
+__RCSID("$NetBSD: tdelete.c,v 1.6 2012/06/25 22:32:45 abs Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
__FBSDID("$FreeBSD$");
@@ -25,9 +25,9 @@ __FBSDID("$FreeBSD$");
/*
- * delete node with given key
+ * find a node with given key
*
- * vkey: key to be deleted
+ * vkey: key to be found
* vrootp: address of the root of the tree
* compar: function to carry out node comparisons
*/
@@ -65,7 +65,8 @@ tdelete(const void * __restrict vkey, void ** __restrict vrootp,
q->rlink = (*rootp)->rlink;
}
}
- free(*rootp); /* D4: Free node */
+ if (p != *rootp)
+ free(*rootp); /* D4: Free node */
*rootp = q; /* link parent to new node */
return p;
}
diff --git a/lib/libc/string/strlcat.c b/lib/libc/string/strlcat.c
index 2d13be77f131..f5ed6c6cf70c 100644
--- a/lib/libc/string/strlcat.c
+++ b/lib/libc/string/strlcat.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strlcat.c,v 1.15 2015/03/02 21:41:08 millert Exp $ */
/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -23,36 +23,36 @@ __FBSDID("$FreeBSD$");
#include <string.h>
/*
- * Appends src to string dst of size siz (unlike strncat, siz is the
- * full size of dst, not space left). At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
- * Returns strlen(src) + MIN(siz, strlen(initial dst)).
- * If retval >= siz, truncation occurred.
+ * Appends src to string dst of size dsize (unlike strncat, dsize is the
+ * full size of dst, not space left). At most dsize-1 characters
+ * will be copied. Always NUL terminates (unless dsize <= strlen(dst)).
+ * Returns strlen(src) + MIN(dsize, strlen(initial dst)).
+ * If retval >= dsize, truncation occurred.
*/
size_t
-strlcat(char * __restrict dst, const char * __restrict src, size_t siz)
+strlcat(char * __restrict dst, const char * __restrict src, size_t dsize)
{
- char *d = dst;
- const char *s = src;
- size_t n = siz;
+ const char *odst = dst;
+ const char *osrc = src;
+ size_t n = dsize;
size_t dlen;
- /* Find the end of dst and adjust bytes left but don't go past end */
- while (n-- != 0 && *d != '\0')
- d++;
- dlen = d - dst;
- n = siz - dlen;
+ /* Find the end of dst and adjust bytes left but don't go past end. */
+ while (n-- != 0 && *dst != '\0')
+ dst++;
+ dlen = dst - odst;
+ n = dsize - dlen;
- if (n == 0)
- return(dlen + strlen(s));
- while (*s != '\0') {
- if (n != 1) {
- *d++ = *s;
+ if (n-- == 0)
+ return(dlen + strlen(src));
+ while (*src != '\0') {
+ if (n != 0) {
+ *dst++ = *src;
n--;
}
- s++;
+ src++;
}
- *d = '\0';
+ *dst = '\0';
- return(dlen + (s - src)); /* count does not include NUL */
+ return(dlen + (src - osrc)); /* count does not include NUL */
}
diff --git a/lib/libc/string/strlcpy.c b/lib/libc/string/strlcpy.c
index 451b6df7980d..019d2316a046 100644
--- a/lib/libc/string/strlcpy.c
+++ b/lib/libc/string/strlcpy.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */
+/* $OpenBSD: strlcpy.c,v 1.12 2015/01/15 03:54:12 millert Exp $ */
/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -23,32 +23,31 @@ __FBSDID("$FreeBSD$");
#include <string.h>
/*
- * Copy src to string dst of size siz. At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz == 0).
- * Returns strlen(src); if retval >= siz, truncation occurred.
+ * Copy string src to buffer dst of size dsize. At most dsize-1
+ * chars will be copied. Always NUL terminates (unless dsize == 0).
+ * Returns strlen(src); if retval >= dsize, truncation occurred.
*/
size_t
-strlcpy(char * __restrict dst, const char * __restrict src, size_t siz)
+strlcpy(char * __restrict dst, const char * __restrict src, size_t dsize)
{
- char *d = dst;
- const char *s = src;
- size_t n = siz;
+ const char *osrc = src;
+ size_t nleft = dsize;
- /* Copy as many bytes as will fit */
- if (n != 0) {
- while (--n != 0) {
- if ((*d++ = *s++) == '\0')
+ /* Copy as many bytes as will fit. */
+ if (nleft != 0) {
+ while (--nleft != 0) {
+ if ((*dst++ = *src++) == '\0')
break;
}
}
- /* Not enough room in dst, add NUL and traverse rest of src */
- if (n == 0) {
- if (siz != 0)
- *d = '\0'; /* NUL-terminate dst */
- while (*s++)
+ /* Not enough room in dst, add NUL and traverse rest of src. */
+ if (nleft == 0) {
+ if (dsize != 0)
+ *dst = '\0'; /* NUL-terminate dst */
+ while (*src++)
;
}
- return(s - src - 1); /* count does not include NUL */
+ return(src - osrc - 1); /* count does not include NUL */
}
diff --git a/lib/libc/string/strspn.3 b/lib/libc/string/strspn.3
index 542b190f6412..4a8e3f40ce59 100644
--- a/lib/libc/string/strspn.3
+++ b/lib/libc/string/strspn.3
@@ -71,7 +71,7 @@ spans the initial part of the null-terminated string
.Fa s
as long as the characters from
.Fa s
-.Sy do not
+.Sy do not
occur in the null-terminated string
.Fa charset
.Po it spans the
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index c14b35111e78..5162563136d2 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -20,17 +20,62 @@ NOASM+= clock_gettime.o gettimeofday.o
PSEUDO+= _clock_gettime.o _gettimeofday.o
# Sources common to both syscall interfaces:
-SRCS+= stack_protector.c stack_protector_compat.c __error.c
-.if ${MK_SYSCALL_COMPAT} != "no"
-SYSCALL_COMPAT_SRCS= fcntl.c ftruncate.c lseek.c mmap.c pread.c \
- pwrite.c truncate.c
-SRCS+= ${SYSCALL_COMPAT_SRCS}
-NOASM+= ${SYSCALL_COMPAT_SRCS:S/.c/.o/}
-PSEUDO+= _fcntl.o
+SRCS+= \
+ stack_protector.c \
+ stack_protector_compat.c \
+ __error.c \
+ interposing_table.c
+
+SRCS+= futimens.c utimensat.c
+NOASM+= futimens.o utimensat.o
+PSEUDO+= _futimens.o _utimensat.o
+
+INTERPOSED = \
+ accept \
+ accept4 \
+ aio_suspend \
+ close \
+ connect \
+ fcntl \
+ fsync \
+ fork \
+ kevent \
+ msync \
+ nanosleep \
+ open \
+ openat \
+ poll \
+ ppoll \
+ pselect \
+ read \
+ readv \
+ recvfrom \
+ recvmsg \
+ select \
+ sendmsg \
+ sendto \
+ setcontext \
+ sigprocmask \
+ sigsuspend \
+ sigtimedwait \
+ sigwait \
+ sigwaitinfo \
+ swapcontext \
+ wait4 \
+ wait6 \
+ write \
+ writev
+
+.if ${MACHINE_CPUARCH} == "sparc64"
+SRCS+= sigaction.c
+NOASM+= sigaction.o
+.else
+INTERPOSED+= sigaction
.endif
-SRCS+= sigwait.c
-NOASM+= sigwait.o
-PSEUDO+= _sigwait.o
+
+SRCS+= ${INTERPOSED:S/$/.c/}
+NOASM+= ${INTERPOSED:S/$/.o/}
+PSEUDO+= ${INTERPOSED:C/^.*$/_&.o/}
# Add machine dependent asm sources:
SRCS+=${MDASM}
@@ -266,6 +311,7 @@ MAN+= sctp_generic_recvmsg.2 \
umask.2 \
undelete.2 \
unlink.2 \
+ utimensat.2 \
utimes.2 \
utrace.2 \
uuidgen.2 \
@@ -398,6 +444,7 @@ MLINKS+=timer_settime.2 timer_getoverrun.2 \
timer_settime.2 timer_gettime.2
MLINKS+=truncate.2 ftruncate.2
MLINKS+=unlink.2 unlinkat.2
+MLINKS+=utimensat.2 futimens.2
MLINKS+=utimes.2 futimes.2 \
utimes.2 futimesat.2 \
utimes.2 lutimes.2
diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map
index 448bcce26753..194aa5bf0999 100644
--- a/lib/libc/sys/Symbol.map
+++ b/lib/libc/sys/Symbol.map
@@ -245,7 +245,6 @@ FBSD_1.0 {
setaudit;
setaudit_addr;
setauid;
- setcontext;
setegid;
seteuid;
setgid;
@@ -286,7 +285,6 @@ FBSD_1.0 {
__stack_chk_guard;
stat;
statfs;
- swapcontext;
swapoff;
swapon;
symlink;
@@ -351,7 +349,6 @@ FBSD_1.1 {
mkfifoat;
mknodat;
msgctl;
- openat;
readlinkat;
renameat;
setfib;
@@ -400,7 +397,9 @@ FBSD_1.3 {
};
FBSD_1.4 {
+ futimens;
ppoll;
+ utimensat;
};
FBSDprivate_1.0 {
@@ -1048,7 +1047,9 @@ FBSDprivate_1.0 {
__sys_write;
_writev;
__sys_writev;
- __error_unthreaded;
+ __set_error_selector;
nlm_syscall;
gssd_syscall;
+ __libc_interposing_slot;
+ __libc_sigwait;
};
diff --git a/lib/libc/sys/__error.c b/lib/libc/sys/__error.c
index c3f59f8bf828..28cc31dde177 100644
--- a/lib/libc/sys/__error.c
+++ b/lib/libc/sys/__error.c
@@ -32,14 +32,25 @@ __FBSDID("$FreeBSD$");
extern int errno;
-/*
- * Declare a weak reference in case the application is not linked
- * with libpthread.
- */
-__weak_reference(__error_unthreaded, __error);
+static int *
+__error_unthreaded(void)
+{
+
+ return (&errno);
+}
+
+static int *(*__error_selector)(void) = __error_unthreaded;
+
+void
+__set_error_selector(int *(*arg)(void))
+{
+
+ __error_selector = arg;
+}
int *
-__error_unthreaded(void)
+__error(void)
{
- return(&errno);
+
+ return (__error_selector());
}
diff --git a/lib/libc/sys/accept.c b/lib/libc/sys/accept.c
new file mode 100644
index 000000000000..38e32f2c836d
--- /dev/null
+++ b/lib/libc/sys/accept.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014 The FreeBSD Foundation.
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice(s), this list of conditions and the following disclaimer as
+ * the first lines of this file unmodified other than the possible
+ * addition of one or more copyright notices.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice(s), this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <sys/socket.h>
+#include "libc_private.h"
+
+__weak_reference(__sys_accept, __accept);
+
+#pragma weak accept
+int
+accept(int s, struct sockaddr *addr, socklen_t *addrlen)
+{
+
+ return (((int (*)(int, struct sockaddr *, socklen_t *))
+ __libc_interposing[INTERPOS_accept])(s, addr, addrlen));
+}
diff --git a/lib/libc/sys/accept4.c b/lib/libc/sys/accept4.c
new file mode 100644
index 000000000000..2907b047efdc
--- /dev/null
+++ b/lib/libc/sys/accept4.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014 The FreeBSD Foundation.
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice(s), this list of conditions and the following disclaimer as
+ * the first lines of this file unmodified other than the possible
+ * addition of one or more copyright notices.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice(s), this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <sys/socket.h>
+#include "libc_private.h"
+
+__weak_reference(__sys_accept4, __accept4);
+
+#pragma weak accept4
+int
+accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags)
+{
+
+ return (((int (*)(int, struct sockaddr *, socklen_t *, int))
+ __libc_interposing[INTERPOS_accept4])(s, addr, addrlen, flags));
+}
diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2
index 46bf9488de81..c70e7a2d5313 100644
--- a/lib/libc/sys/access.2
+++ b/lib/libc/sys/access.2
@@ -136,7 +136,7 @@ and
.Fn access ,
.Fn eaccess ,
or
-.Fn faccessat
+.Fn faccessat
will fail if:
.Bl -tag -width Er
.It Bq Er EINVAL
diff --git a/lib/libc/sys/aio_suspend.c b/lib/libc/sys/aio_suspend.c
new file mode 100644
index 000000000000..020edf8a74fa
--- /dev/null
+++ b/lib/libc/sys/aio_suspend.c
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014 The FreeBSD Foundation.
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice(s), this list of conditions and the following disclaimer as
+ * the first lines of this file unmodified other than the possible
+ * addition of one or more copyright notices.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice(s), this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/aio.h>
+#include "libc_private.h"
+
+__weak_reference(__sys_aio_suspend, __aio_suspend);
+
+#pragma weak aio_suspend
+int
+aio_suspend(const struct aiocb * const iocbs[], int niocb,
+ const struct timespec *timeout)
+{
+
+ return (((int (*)(const struct aiocb * const[], int,
+ const struct timespec *))
+ __libc_interposing[INTERPOS_aio_suspend])(iocbs, niocb, timeout));
+}
diff --git a/lib/libc/sys/cap_ioctls_limit.2 b/lib/libc/sys/cap_ioctls_limit.2
index 2d1eef9724c4..39f117f03087 100644
--- a/lib/libc/sys/cap_ioctls_limit.2
+++ b/lib/libc/sys/cap_ioctls_limit.2
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 27, 2014
+.Dd March 6, 2015
.Dt CAP_IOCTLS_LIMIT 2
.Os
.Sh NAME
@@ -61,6 +61,8 @@ argument specifies the number of elements in the array.
There can be up to
.Va 256
elements in the array.
+Including an element that has been previously revoked will generate an error.
+After a successful call only those listed in the array may be used.
.Pp
The list of allowed ioctl commands for a given file descriptor can be obtained
with the
@@ -92,7 +94,7 @@ system call was never called for this file descriptor), the
.Fn cap_ioctls_get
system call will return
.Dv CAP_IOCTLS_ALL
-and won't modify the buffer pointed to by the
+and will not modify the buffer pointed to by the
.Fa cmds
argument.
.Sh RETURN VALUES
diff --git a/lib/libc/sys/close.c b/lib/libc/sys/close.c
new file mode 100644
index 000000000000..02e74c633001
--- /dev/null
+++ b/lib/libc/sys/close.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014 The FreeBSD Foundation.
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice(s), this list of conditions and the following disclaimer as
+ * the first lines of this file unmodified other than the possible
+ * addition of one or more copyright notices.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice(s), this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/fcntl.h>
+#include "libc_private.h"
+
+__weak_reference(__sys_close, __close);
+
+#pragma weak close
+int
+close(int fd)
+{
+
+ return (((int (*)(int))__libc_interposing[INTERPOS_close])(fd));
+}
diff --git a/lib/libc/sys/closefrom.2 b/lib/libc/sys/closefrom.2
index ffaa0012bae9..a0b5fc218666 100644
--- a/lib/libc/sys/closefrom.2
+++ b/lib/libc/sys/closefrom.2
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2009 Advanced Computing Technologies LLC
+.\" Copyright (c) 2009 Hudson River Trading LLC
.\" Written by: John H. Baldwin <jhb@FreeBSD.org>
.\" All rights reserved.
.\"
diff --git a/lib/libc/sys/connect.c b/lib/libc/sys/connect.c
new file mode 100644
index 000000000000..7969142ad072
--- /dev/null
+++ b/lib/libc/sys/connect.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014 The FreeBSD Foundation.
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice(s), this list of conditions and the following disclaimer as
+ * the first lines of this file unmodified other than the possible
+ * addition of one or more copyright notices.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice(s), this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <sys/socket.h>
+#include "libc_private.h"
+
+__weak_reference(__sys_connect, __connect);
+
+#pragma weak connect
+int
+connect(int s, const struct sockaddr *addr, socklen_t addrlen)
+{
+
+ return (((int (*)(int, const struct sockaddr *, socklen_t))
+ __libc_interposing[INTERPOS_connect])(s, addr, addrlen));
+}
diff --git a/lib/libc/sys/cpuset.2 b/lib/libc/sys/cpuset.2
index 0c32b42192e8..83495662ac88 100644
--- a/lib/libc/sys/cpuset.2
+++ b/lib/libc/sys/cpuset.2
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 14, 2014
+.Dd January 8, 2015
.Dt CPUSET 2
.Os
.Sh NAME
@@ -101,6 +101,7 @@ argument may have the following values:
.It Dv CPU_WHICH_JAIL Ta "id is jid (jail id)"
.It Dv CPU_WHICH_CPUSET Ta "id is a cpusetid_t (cpuset id)"
.It Dv CPU_WHICH_IRQ Ta "id is an irq number"
+.It Dv CPU_WHICH_DOMAIN Ta "id is a NUMA domain"
.El
.Pp
An
diff --git a/lib/libc/sys/fcntl.c b/lib/libc/sys/fcntl.c
index 480cc40cb69e..e85574a6e0e3 100644
--- a/lib/libc/sys/fcntl.c
+++ b/lib/libc/sys/fcntl.c
@@ -3,6 +3,12 @@
* Authors: Doug Rabson <dfr@rabson.org>
* Developed with Red Inc: Alfred Perlstein <alfred@freebsd.org>
*
+ * Copyright (c) 2014-2015 The FreeBSD Foundation.
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,56 +40,17 @@ __FBSDID("$FreeBSD$");
#include <sys/syscall.h>
#include "libc_private.h"
-__weak_reference(__fcntl_compat, fcntl);
-
+#pragma weak fcntl
int
-__fcntl_compat(int fd, int cmd, ...)
+fcntl(int fd, int cmd, ...)
{
va_list args;
long arg;
- struct __oflock ofl;
- struct flock *flp;
- int res;
va_start(args, cmd);
arg = va_arg(args, long);
va_end(args);
- if (__getosreldate() >= 800028) {
- return (__sys_fcntl(fd, cmd, arg));
- } else {
- if (cmd == F_GETLK || cmd == F_SETLK || cmd == F_SETLKW) {
- /*
- * Convert new-style struct flock (which
- * includes l_sysid) to old-style.
- */
- flp = (struct flock *) (uintptr_t) arg;
- ofl.l_start = flp->l_start;
- ofl.l_len = flp->l_len;
- ofl.l_pid = flp->l_pid;
- ofl.l_type = flp->l_type;
- ofl.l_whence = flp->l_whence;
-
- switch (cmd) {
- case F_GETLK:
- res = __sys_fcntl(fd, F_OGETLK, &ofl);
- if (res >= 0) {
- flp->l_start = ofl.l_start;
- flp->l_len = ofl.l_len;
- flp->l_pid = ofl.l_pid;
- flp->l_type = ofl.l_type;
- flp->l_whence = ofl.l_whence;
- flp->l_sysid = 0;
- }
- return (res);
-
- case F_SETLK:
- return (__sys_fcntl(fd, F_OSETLK, &ofl));
-
- case F_SETLKW:
- return (__sys_fcntl(fd, F_OSETLKW, &ofl));
- }
- }
- return (__sys_fcntl(fd, cmd, arg));
- }
+ return (((int (*)(int, int, ...))
+ __libc_interposing[INTERPOS_fcntl])(fd, cmd, arg));
}
diff --git a/lib/libc/sys/fork.2 b/lib/libc/sys/fork.2
index 1ad2052ff069..4fda74d605e7 100644
--- a/lib/libc/sys/fork.2
+++ b/lib/libc/sys/fork.2
@@ -28,7 +28,7 @@
.\" @(#)fork.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd May 31, 2013
+.Dd May 1, 2015
.Dt FORK 2
.Os
.Sh NAME
@@ -53,7 +53,10 @@ The child process has a unique process ID.
The child process has a different parent
process ID (i.e., the process ID of the parent process).
.It
-The child process has its own copy of the parent's descriptors.
+The child process has its own copy of the parent's descriptors,
+except for descriptors returned by
+.Xr kqueue 2 ,
+which are not inherited from the parent process.
These descriptors reference the same underlying objects, so that,
for instance, file pointers in file objects are shared between
the child and the parent, so that an
diff --git a/lib/libc/sys/fork.c b/lib/libc/sys/fork.c
new file mode 100644
index 000000000000..695540a7264f
--- /dev/null
+++ b/lib/libc/sys/fork.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014 The FreeBSD Foundation.
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice(s), this list of conditions and the following disclaimer as
+ * the first lines of this file unmodified other than the possible
+ * addition of one or more copyright notices.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice(s), this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#