The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge commit '672965bfda6220c690d26ff6a0b7a9a59519d9af' into 5.00

+493 -331
+39
Changes
··· 11 11 *blit_* function during Mark phase 12 12 (François Bobot, reported by Stephen Dolan, reviewed by Damien Doligez) 13 13 14 + - #10549: Stack overflow detection and naked pointers checking for ARM64 15 + (Xavier Leroy, review by Stephen Dolan) 16 + 17 + 14 18 ### Code generation and optimizations: 15 19 16 20 ### Standard library: ··· 33 37 to emulate Unix.socketpair (only available on Windows 1803+) 34 38 (Antonin Décimo, review by David Allsopp) 35 39 40 + - #10469: Add Thread.set_uncaught_exception_handler and 41 + Thread.default_uncaught_exception_handler. 42 + (Enguerrand Decorne, review by David Allsopp) 43 + 36 44 ### Tools: 37 45 38 46 - #3959, #7202, #10476: ocaml, in script mode, directive errors ··· 42 50 - #10524: Directive argument type error now shows expected and received type. 43 51 (Wiktor Kuchta, review by Gabriel Scherer) 44 52 53 + - #10560: Disable colors if the env variable `NO_COLOR` is set. If 54 + `OCAML_COLOR` is set, its setting takes precedence over `NO_COLOR`. 55 + (Nicolás Ojeda Bär, report by Gabriel Scherer, review by Daniel Bünzli, 56 + Gabriel Scherer and David Allsopp) 57 + 45 58 ### Manual and documentation: 46 59 47 60 - #7812, #10475: reworded the description of the behaviors of ··· 61 74 - #10407: Produce more detailed error messages that contain full error traces 62 75 when module inclusion fails. 63 76 (Antal Spector-Zabusky, review by Florian Angeletti) 77 + 78 + - #10531: add naked_pointers to ocamlc -config exporting NAKED_POINTERS from 79 + Makefile.config. 80 + (Damien Doligez, review by Mark Shinwell and Gabriel Scherer) 64 81 65 82 ### Internal/compiler-libs changes: 66 83 ··· 186 203 platforms without AFL support. 187 204 (David Allsopp, review by Xavier Leroy) 188 205 206 + - #10195: Speed up GC by prefetching during marking 207 + (Stephen Dolan, review by Xavier Leroy, Guillaume Munch-Maccagnoni, 208 + Jacques-Henri Jourdan and Damien Doligez) 209 + 189 210 * #10098: Improve command-line parsing in ocamlrun: strictly recognise options, 190 211 be more informative for `ocamlrun -I` and support `--` for terminating options 191 212 parsing. ··· 415 436 416 437 - #9632: Document incremental build solutions with opam 417 438 (Vincent Laviron, review by Daniel Bünzli and Gabriel Scherer) 439 + 440 + - #10497: Styling changes in the post-processed HTML manual (webman) 441 + (Wiktor Kuchta, review by Florian Angeletti) 418 442 419 443 ### Compiler user-interface and warnings: 420 444 ··· 699 723 - #10376: Link runtime libraries correctly on msvc64 in -output-complete-obj 700 724 (David Allsopp, review by Gabriel Scherer) 701 725 726 + - #10380: Correct handling of UTF-8 paths in configure on Windows 727 + (David Allsopp, review by Sébastien Hinderer) 728 + 702 729 - #10449: Fix major GC work accounting (the GC was running too fast). 703 730 (Damien Doligez, report by Stephen Dolan, review by Nicolás Ojeda Bär 704 731 and Sadiq Jaffer) 732 + 733 + - #10450, #10558: keep %apply and %revapply primitives working with abstract 734 + types. This breach of backward compatibility was only present in the alpha 735 + releases of OCaml 4.13.0 . 736 + (Florian Angeletti, review by Thomas Refis and Leo White) 705 737 706 738 - #10454: Check row_more in nondep_type_rec. 707 739 (Leo White, review by Thomas Refis) ··· 717 749 ------------------------------- 718 750 719 751 ### Bug fixes: 752 + 753 + - #10442, #10446: Fix regression in the toplevel to #directory caused by 754 + corrections and improvements to the Load_path in #9611. #directory now 755 + adds the path to the start of the load path again (so files in the newly 756 + added directory take priority). 757 + (David Allsopp, report by Vasile Rotaru, review by Florian Angeletti 758 + and Nicolás Ojeda Bär) 720 759 721 760 - #10478: Fix segfault under Windows due to a mistaken initialization of thread 722 761 ID when a thread starts.
+1
Makefile
··· 1145 1145 rm -f tools/eventlog_metadata 1146 1146 rm -f tools/*.bak 1147 1147 rm -f testsuite/_log* 1148 + $(MAKE) -C stdlib distclean 1148 1149 1149 1150 include .depend 1150 1151
-19
Makefile.config.in
··· 263 263 $(OUTPUTEXE)$(1) $(2) 264 264 endif # ifeq "$(TOOLCHAIN)" "msvc" 265 265 266 - # The following variables were defined only in the Windows-specific makefiles. 267 - # They were not defined by the configure script used on Unix systems, 268 - # so we also make sure to provide them only under Windows 269 - # User code should absolutely not rely on their presence because 270 - # in the future their definition may be moved to a more private part of 271 - # the compiler's build system 272 - ifeq "$(UNIX_OR_WIN32)" "win32" 273 - CYGPATH=cygpath -m 274 - DIFF=/usr/bin/diff -q --strip-trailing-cr 275 - FIND=/usr/bin/find 276 - SORT=/usr/bin/sort 277 - SET_LD_PATH=PATH="$(PATH):$(LD_PATH)" 278 - else # ifeq "$(UNIX_OR_WIN32)" "win32" 279 - # On Unix, make sure FLEXLINK is defined but empty 280 - SORT=sort 281 - CYGPATH=echo 282 - SET_LD_PATH=CAML_LD_LIBRARY_PATH="$(LD_PATH)" 283 - endif # ifeq "$(UNIX_OR_WIN32)" "win32" 284 - 285 266 FLEXLINK_FLAGS=@flexlink_flags@ 286 267 FLEXLINK_CMD=flexlink 287 268 FLEXLINK=$(FLEXLINK_CMD) $(FLEXLINK_FLAGS)
+1 -1
README.stock.adoc
··· 111 111 112 112 https://ocaml.org/community/ 113 113 114 - In particular, the IRC channel `#ocaml` on https://freenode.net/[Freenode] has a 114 + In particular, the IRC channel `#ocaml` on https://libera.chat/[Libera] has a 115 115 long history and welcomes questions. 116 116 117 117 == Bug Reports and User Feedback
+2 -2
README.win32.adoc
··· 201 201 202 202 for 32-bit, or: 203 203 204 - ./configure --build=x86_64-unknown-cygwin --host=x86_64-pc-windows 204 + ./configure --build=x86_64-pc-cygwin --host=x86_64-pc-windows 205 205 206 206 for 64-bit. 207 207 ··· 266 266 267 267 for 32-bit, or: 268 268 269 - ./configure --build=x86_64-unknown-cygwin --host=x86_64-w64-mingw32 269 + ./configure --build=x86_64-pc-cygwin --host=x86_64-w64-mingw32 270 270 271 271 for 64-bit. 272 272
+7 -3
configure
··· 2956 2956 2957 2957 ac_config_files="$ac_config_files Makefile.config" 2958 2958 2959 + ac_config_files="$ac_config_files stdlib/sys.ml" 2960 + 2959 2961 ac_config_files="$ac_config_files tools/eventlog_metadata" 2960 2962 2961 2963 ac_config_headers="$ac_config_headers runtime/caml/m.h" ··· 16613 16615 16614 16616 case $arch,$system in #( 16615 16617 i386,linux_elf|amd64,linux|amd64,macosx \ 16616 - |amd64,openbsd|i386,bsd_elf) : 16618 + |amd64,openbsd|i386,bsd_elf|arm64,linux|arm64,macosx) : 16617 16619 $as_echo "#define HAS_STACK_OVERFLOW_DETECTION 1" >>confdefs.h 16618 16620 16619 16621 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ··· 17517 17519 case "$arch","$system" in #( 17518 17520 amd64,linux|amd64,macosx \ 17519 17521 |amd64,openbsd|amd64,win64 \ 17520 - |amd64,freebsd|amd64,solaris) : 17522 + |amd64,freebsd|amd64,solaris \ 17523 + |arm64,linux|arm64,macosx) : 17521 17524 naked_pointers_checker=true 17522 17525 $as_echo "#define NAKED_POINTERS_CHECKER 1" >>confdefs.h 17523 17526 ;; #( ··· 17858 17861 && test "$host_vendor-$host_os" != "$build_vendor-$build_os" ; then : 17859 17862 case $build in #( 17860 17863 *-pc-cygwin) : 17861 - prefix=`cygpath -m "$prefix"` ;; #( 17864 + prefix="$(LC_ALL=C.UTF-8 cygpath -m "$prefix")" ;; #( 17862 17865 *) : 17863 17866 ;; 17864 17867 esac ··· 18888 18891 case $ac_config_target in 18889 18892 "Makefile.build_config") CONFIG_FILES="$CONFIG_FILES Makefile.build_config" ;; 18890 18893 "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;; 18894 + "stdlib/sys.ml") CONFIG_FILES="$CONFIG_FILES stdlib/sys.ml" ;; 18891 18895 "tools/eventlog_metadata") CONFIG_FILES="$CONFIG_FILES tools/eventlog_metadata" ;; 18892 18896 "runtime/caml/m.h") CONFIG_HEADERS="$CONFIG_HEADERS runtime/caml/m.h" ;; 18893 18897 "runtime/caml/s.h") CONFIG_HEADERS="$CONFIG_HEADERS runtime/caml/s.h" ;;
+5 -3
configure.ac
··· 178 178 179 179 AC_CONFIG_FILES([Makefile.build_config]) 180 180 AC_CONFIG_FILES([Makefile.config]) 181 + AC_CONFIG_FILES([stdlib/sys.ml]) 181 182 AC_CONFIG_FILES([tools/eventlog_metadata]) 182 183 AC_CONFIG_HEADERS([runtime/caml/m.h]) 183 184 AC_CONFIG_HEADERS([runtime/caml/s.h]) ··· 1784 1785 1785 1786 AS_CASE([$arch,$system], 1786 1787 [i386,linux_elf|amd64,linux|amd64,macosx \ 1787 - |amd64,openbsd|i386,bsd_elf], 1788 + |amd64,openbsd|i386,bsd_elf|arm64,linux|arm64,macosx], 1788 1789 [AC_DEFINE([HAS_STACK_OVERFLOW_DETECTION]) 1789 1790 AC_MSG_RESULT([yes])], 1790 1791 [AC_MSG_RESULT([no])]) ··· 1847 1848 AS_CASE(["$arch","$system"], 1848 1849 [amd64,linux|amd64,macosx \ 1849 1850 |amd64,openbsd|amd64,win64 \ 1850 - |amd64,freebsd|amd64,solaris], 1851 + |amd64,freebsd|amd64,solaris \ 1852 + |arm64,linux|arm64,macosx], 1851 1853 [naked_pointers_checker=true 1852 1854 AC_DEFINE([NAKED_POINTERS_CHECKER])], 1853 1855 [*], ··· 1998 2000 [AS_IF([test x"$unix_or_win32" = "xwin32" \ 1999 2001 && test "$host_vendor-$host_os" != "$build_vendor-$build_os" ], 2000 2002 [AS_CASE([$build], 2001 - [*-pc-cygwin], [prefix=`cygpath -m "$prefix"`])])]) 2003 + [*-pc-cygwin], [prefix="$(LC_ALL=C.UTF-8 cygpath -m "$prefix")"])])]) 2002 2004 2003 2005 # Define a few macros that were defined in config/m-nt.h 2004 2006 # but whose value is not guessed properly by configure
+5
driver/compmisc.ml
··· 68 68 69 69 let read_clflags_from_env () = 70 70 set_from_env Clflags.color Clflags.color_reader; 71 + if 72 + Option.is_none !Clflags.color && 73 + Option.is_some (Sys.getenv_opt "NO_COLOR") 74 + then 75 + Clflags.color := Some Misc.Color.Never; 71 76 set_from_env Clflags.error_style Clflags.error_style_reader; 72 77 () 73 78
+6 -4
man/ocaml.m
··· 254 254 .B never 255 255 disable color output. 256 256 257 - The default setting is 257 + The environment variable "OCAML_COLOR" is considered if \-color is not 258 + provided. Its values are auto/always/never as above. 259 + 260 + If \-color is not provided, "OCAML_COLOR" is not set and the environment 261 + variable "NO_COLOR" is set, then color output is disabled. Otherwise, 262 + the default setting is 258 263 .B auto, 259 264 and the current heuristic 260 265 checks that the "TERM" environment variable exists and is 261 266 not empty or "dumb", and that isatty(stderr) holds. 262 - 263 - The environment variable "OCAML_COLOR" is considered if \-color is not 264 - provided. Its values are auto/always/never as above. 265 267 266 268 .TP 267 269 .BI \-error\-style \ mode
+6 -4
man/ocamlc.m
··· 268 268 .B never 269 269 disable color output. 270 270 271 - The default setting is 271 + The environment variable "OCAML_COLOR" is considered if \-color is not 272 + provided. Its values are auto/always/never as above. 273 + 274 + If \-color is not provided, "OCAML_COLOR" is not set and the environment 275 + variable "NO_COLOR" is set, then color output is disabled. Otherwise, 276 + the default setting is 272 277 .B auto, 273 278 and the current heuristic 274 279 checks that the "TERM" environment variable exists and is 275 280 not empty or "dumb", and that isatty(stderr) holds. 276 - 277 - The environment variable "OCAML_COLOR" is considered if \-color is not 278 - provided. Its values are auto/always/never as above. 279 281 280 282 .TP 281 283 .BI \-error\-style \ mode
+6 -4
man/ocamlopt.m
··· 224 224 .B never 225 225 disable color output. 226 226 227 - The default setting is 227 + The environment variable "OCAML_COLOR" is considered if \-color is not 228 + provided. Its values are auto/always/never as above. 229 + 230 + If \-color is not provided, "OCAML_COLOR" is not set and the environment 231 + variable "NO_COLOR" is set, then color output is disabled. Otherwise, 232 + the default setting is 228 233 .B auto, 229 234 and the current heuristic 230 235 checks that the "TERM" environment variable exists and is 231 236 not empty or "dumb", and that isatty(stderr) holds. 232 - 233 - The environment variable "OCAML_COLOR" is considered if \-color is not 234 - provided. Its values are auto/always/never as above. 235 237 236 238 .TP 237 239 .BI \-error\-style \ mode
+1 -2
manual/src/Makefile
··· 3 3 4 4 export LD_LIBRARY_PATH ?= "$(SRC)/otherlibs/unix/:$(SRC)/otherlibs/str/" 5 5 export DYLD_LIBRARY_PATH ?= "$(SRC)/otherlibs/unix/:$(SRC)/otherlibs/str/" 6 - SET_LD_PATH = CAML_LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) 7 6 8 7 TEXQUOTE = $(SRC)/runtime/ocamlrun ../tools/texquote2 9 8 ··· 136 135 echo "% are inserted through the Makefile, which should be updated";\ 137 136 echo "% when a new warning is documented.";\ 138 137 echo "%";\ 139 - $(SET_LD_PATH) $(SRC)/boot/ocamlrun $(SRC)/ocamlc -warn-help \ 138 + $(SRC)/boot/ocamlrun $(SRC)/ocamlc -warn-help \ 140 139 | LC_ALL=C sed -e 's/^ *\([0-9][0-9]*\) *\[\([a-z][a-z-]*\)\]\(.*\)/\\item[\1 "\2"] \3/' \ 141 140 -e 's/^ *\([0-9A-Z][0-9]*\) *\([^]].*\)/\\item[\1] \2/'\ 142 141 | sed -e 's/@/\\@/g' \
+4 -5
manual/src/cmds/Makefile
··· 1 1 ROOTDIR = ../../.. 2 2 include $(ROOTDIR)/Makefile.common 3 3 4 - LD_PATH = "$(ROOTDIR)/otherlibs/str:$(ROOTDIR)/otherlibs/unix" 4 + LD_PATH = $(ROOTDIR)/otherlibs/str $(ROOTDIR)/otherlibs/unix 5 5 6 6 TOOLS = ../../tools 7 - CAMLLATEX = $(SET_LD_PATH) \ 8 - $(OCAMLRUN) $(ROOTDIR)/tools/caml-tex \ 9 - -repo-root $(ROOTDIR) -n 80 -v false 7 + CAMLLATEX = $(OCAMLRUN) $(addprefix -I ,$(LD_PATH)) \ 8 + $(ROOTDIR)/tools/caml-tex -repo-root $(ROOTDIR) -n 80 -v false 10 9 TEXQUOTE = $(OCAMLRUN) $(TOOLS)/texquote2 11 - TRANSF = $(SET_LD_PATH) $(OCAMLRUN) $(TOOLS)/transf 10 + TRANSF = $(OCAMLRUN) $(TOOLS)/transf 12 11 13 12 FILES = comp.tex top.tex runtime.tex native.tex lexyacc.tex intf-c.tex \ 14 13 ocamldep.tex profil.tex debugger.tex ocamldoc.tex \
+6 -3
manual/src/cmds/unified-options.etex
··· 126 126 \item["always"] enable colors unconditionally; 127 127 \item["never"] disable color output. 128 128 \end{description} 129 - The default setting is 'auto', and the current heuristic 130 - checks that the "TERM" environment variable exists and is 131 - not empty or "dumb", and that 'isatty(stderr)' holds. 132 129 133 130 The environment variable "OCAML_COLOR" is considered if "-color" is not 134 131 provided. Its values are auto/always/never as above. 132 + 133 + If "-color" is not provided, "OCAML_COLOR" is not set and the environment 134 + variable "NO_COLOR" is set, then color output is disabled. Otherwise, 135 + the default setting is 'auto', and the current heuristic 136 + checks that the "TERM" environment variable exists and is 137 + not empty or "dumb", and that 'isatty(stderr)' holds. 135 138 }%notop 136 139 137 140 \notop{%
+10 -6
manual/src/html_processing/scss/_common.scss
··· 19 19 @import url(https://fonts.googleapis.com/css?family=Noticia+Text:400,400i,700); 20 20 @import url(https://fonts.googleapis.com/css?family=Fira+Sans:400,400i,500,500i,600,600i,700,700i); 21 21 22 + $font-sans: "Fira Sans", Helvetica, Arial, sans-serif; 23 + $font-mono: "Fira Mono", courier, monospace; 24 + $font-serif: "Noticia Text", Georgia, serif; 25 + 22 26 /* Reset */ 23 27 .pre,a,b,body,code,div,em,form,h1,h2,h3,h4,h5,h6,header,html,i,img,li,mark,menu,nav,object,output,p,pre,s,section,span,time,ul,td,var{ 24 28 margin:0; ··· 47 51 } 48 52 49 53 body{ 50 - font-family:"Fira Sans",Helvetica,Arial,sans-serif; 54 + font-family: $font-sans; 51 55 text-align:left; 52 56 color:#333; 53 57 background:#fff ··· 76 80 &>header { 77 81 margin-bottom: 30px; 78 82 nav { 79 - font-family: "Fira Sans", Helvetica, Arial, sans-serif; 83 + font-family: $font-sans; 80 84 } 81 85 } 82 86 } ··· 87 91 margin-right:4ex; 88 92 margin-top:20px; 89 93 margin-bottom:50px; 90 - font-family:"Noticia Text",Georgia,serif; 94 + font-family: $font-serif; 91 95 line-height:1.5 92 96 } 93 97 ··· 131 135 padding-left:12px; 132 136 } 133 137 a { 134 - font-family:"Fira Sans",sans-serif; 138 + font-family: $font-sans; 135 139 font-size:.95em; 136 140 color:#333; 137 141 font-weight:400; ··· 250 254 color:$logocolor; 251 255 margin-right:4px; 252 256 margin-left:-1em; 253 - font-family:"Fira Sans",Helvetica,Arial,sans-serif; 257 + font-family: $font-sans; 254 258 font-size:13px; 255 259 vertical-align:1px; 256 260 } ··· 260 264 color:$logocolor; 261 265 margin-right:4px; 262 266 margin-left:-1em; 263 - font-family:"Fira Sans",Helvetica,Arial,sans-serif; 267 + font-family: $font-sans; 264 268 font-size:14px; 265 269 vertical-align:1px; 266 270 }
+54 -15
manual/src/html_processing/scss/manual.scss
··· 16 16 float:left; 17 17 color:#777; 18 18 cursor: context-menu; 19 - font-family:"Fira Sans",Helvetica,Arial,sans-serif; 19 + font-family: $font-sans; 20 20 span{ /* menu icon */ 21 21 font-size:22px; 22 22 margin-right:1ex; ··· 63 63 font-size:smaller; 64 64 } 65 65 section>ul>li>a{ /* for Parts title */ 66 - font-family:"Fira Sans",Helvetica,Arial,sans-serif; 66 + font-family: $font-sans; 67 67 font-size:larger; 68 68 background:linear-gradient(to left,#fff 0,#ede8e5 100%); 69 69 } ··· 143 143 color:#d5d5d5 144 144 } 145 145 .h10,.h7,.h8,.h9,h1,h2,h3,h4,h5,h6{ 146 - font-family:"Fira Sans",Helvetica,Arial,sans-serif; 146 + font-family: $font-sans; 147 147 font-weight:400; 148 148 margin:.5em 0 .5em 0; 149 149 padding-top:.1em; ··· 184 184 } 185 185 h4{ 186 186 font-size:1.12em 187 + } 188 + h2, h3, h4, h5 { 189 + font-weight: 500; 187 190 } 188 191 .ocaml,.pre,code,pre,tt{ 189 - font-family:"Fira Mono",courier; 192 + font-family: $font-mono; 190 193 font-weight:400 191 194 } 192 195 .pre,pre{ ··· 263 266 color: #d28853; 264 267 } 265 268 blockquote.quote{ 266 - margin:0; 267 269 /*font-size: smaller;*/ 268 270 hr{ 269 271 display:none; 270 272 } 271 273 } 272 274 #part-menu{ 273 - font-family:"Fira Sans"; 275 + font-family: $font-sans; 274 276 text-align:right; 275 277 list-style:none; 276 278 overflow-y:hidden; ··· 280 282 color:#000; 281 283 &::before{@include diamond} 282 284 } 285 + .center { 286 + text-align: center; 287 + margin-left: auto; 288 + margin-right: auto; 289 + } 290 + .display { 291 + margin: 0 auto; 292 + } 293 + .c001 { 294 + border-spacing: 6px; 295 + border-collapse: separate; 296 + } 283 297 span.c003{ 284 298 color:#564233; 285 - font-family:"Fira Mono",courier; 286 - background-color:#f3ece6; 299 + font-family: $font-mono; 287 300 border-radius:6px 288 301 } 289 302 div.caml-example.toplevel code.caml-input::before, ··· 294 307 span.number{ 295 308 padding-right: 1ex; 296 309 } 297 - span.c004, span.c002{ 310 + span.c004, span.c005, span.c007 { 311 + font-family: $font-mono; 312 + } 313 + span.c003, span.c005 { 314 + color: rgba(91, 33, 6, 0.87); 315 + } 316 + span.c002{ 298 317 color:#888 299 318 } 300 319 span.c006{ 301 320 font-weight:700; 302 321 color:#564233; 303 - font-family:"Fira Mono",courier; 322 + font-family: $font-mono; 323 + } 324 + .c008 { 325 + font-family: $font-sans; 304 326 } 305 - span.c009{ 306 - font-style:italic; 307 - background-color:#f3ece6; 308 - border-radius:6px 327 + span.c010 { 328 + font-style: italic; 309 329 } 310 330 span.authors{ 311 331 font-style:italic; 312 332 background-color:inherit 313 333 } 334 + span.c011 { 335 + font-style: italic; 336 + } 337 + .c012 { 338 + font-style: italic; 339 + } 314 340 span.c013{ 315 - font-weight:700 341 + font-style: italic; 342 + } 343 + .center table { 344 + margin-left: inherit; 345 + margin-right: inherit; 346 + } 347 + td .c014 { 348 + font-weight: bold; 349 + } 350 + .c016 { 351 + text-align: center; 352 + } 353 + .cellpadding1 tr td { 354 + padding: 1px 4px; 316 355 } 317 356 .caml-input{ 318 357 span.ocamlkeyword{
+7 -8
manual/src/html_processing/scss/style.scss
··· 39 39 40 40 .api { 41 41 // font-size: 16px; 42 - // font-family: "Fira Sans", Helvetica, Arial, sans-serif; 42 + // font-family: $font-sans; 43 43 // text-align: left; 44 44 // color: #333; 45 45 // background: #FFFFFF; ··· 259 259 we restart the sequence there like h2 */ 260 260 261 261 h1, h2, h3, h4, h5, h6, .h7, .h8, .h9, .h10 { 262 - font-family: "Fira Sans", Helvetica, Arial, sans-serif; 262 + font-family: $font-sans; 263 263 font-weight: 400; 264 264 margin: 0.5em 0 0.5em 0; 265 265 padding-top: 0.1em; ··· 316 316 /* Preformatted and code */ 317 317 318 318 tt, code, pre { 319 - font-family: "Fira Mono", courier; 319 + font-family: $font-mono; 320 320 font-weight: 400; 321 321 } 322 322 ··· 705 705 span.arrow { 706 706 font-size: 20px; 707 707 line-height: 8pt; 708 - font-family: "Fira Mono"; 708 + font-family: $font-mono; 709 709 } 710 710 header dl dd, header dl dt { 711 711 display: inline-block; ··· 742 742 } 743 743 744 744 ul.tutos_menu { 745 - font-family: "Fira Sans"; 745 + font-family: $font-sans; 746 746 text-align: right; 747 747 list-style: none; 748 748 } ··· 756 756 } 757 757 758 758 span.c003 { 759 - font-family: "Fira Mono", courier; 759 + font-family: $font-mono; 760 760 background-color: #f3ece6; 761 761 border-radius: 6px; 762 762 } ··· 793 793 794 794 code span.constructor, 795 795 .caml-input span.kw2 { 796 - font-weight: 500; 797 - color: #a28867; 796 + color: #8d543c; 798 797 } 799 798 800 799 .caml-input span.numeric {
+4 -5
manual/src/refman/Makefile
··· 1 1 ROOTDIR = ../../.. 2 2 include $(ROOTDIR)/Makefile.common 3 3 4 - LD_PATH = "$(ROOTDIR)/otherlibs/str:$(ROOTDIR)/otherlibs/unix" 4 + LD_PATH = $(ROOTDIR)/otherlibs/str $(ROOTDIR)/otherlibs/unix 5 5 6 6 TOOLS = ../../tools 7 - CAMLLATEX = $(SET_LD_PATH) \ 8 - $(OCAMLRUN) $(ROOTDIR)/tools/caml-tex \ 9 - -repo-root $(ROOTDIR) -n 80 -v false 7 + CAMLLATEX = $(OCAMLRUN) $(addprefix -I ,$(LD_PATH)) \ 8 + $(ROOTDIR)/tools/caml-tex -repo-root $(ROOTDIR) -n 80 -v false 10 9 TEXQUOTE = $(OCAMLRUN) $(TOOLS)/texquote2 11 - TRANSF = $(SET_LD_PATH) $(OCAMLRUN) $(TOOLS)/transf 10 + TRANSF = $(OCAMLRUN) $(TOOLS)/transf 12 11 13 12 EXTENSION_FILES = letrecvalues.tex recursivemodules.tex locallyabstract.tex \ 14 13 firstclassmodules.tex moduletypeof.tex signaturesubstitution.tex \
+4 -5
manual/src/tutorials/Makefile
··· 1 1 ROOTDIR = ../../.. 2 2 include $(ROOTDIR)/Makefile.common 3 3 4 - LD_PATH = "$(ROOTDIR)/otherlibs/str:$(ROOTDIR)/otherlibs/unix" 4 + LD_PATH = $(ROOTDIR)/otherlibs/str $(ROOTDIR)/otherlibs/unix 5 5 6 6 TOOLS = ../../tools 7 - CAMLLATEX = $(SET_LD_PATH) \ 8 - $(OCAMLRUN) $(ROOTDIR)/tools/caml-tex \ 9 - -repo-root $(ROOTDIR) -n 80 -v false 7 + CAMLLATEX = $(OCAMLRUN) $(addprefix -I ,$(LD_PATH)) \ 8 + $(ROOTDIR)/tools/caml-tex -repo-root $(ROOTDIR) -n 80 -v false 10 9 TEXQUOTE = $(OCAMLRUN) $(TOOLS)/texquote2 11 - TRANSF = $(SET_LD_PATH) $(OCAMLRUN) $(TOOLS)/transf 10 + TRANSF = $(OCAMLRUN) $(TOOLS)/transf 12 11 13 12 14 13 FILES = coreexamples.tex lablexamples.tex polyvariant.tex objectexamples.tex \
+1 -2
manual/tests/Makefile
··· 22 22 # check cross-references between the manual and error messages 23 23 .PHONY: check-cross-references 24 24 check-cross-references: cross-reference-checker 25 - $(SET_LD_PATH) \ 26 - $(OCAMLRUN) ./cross-reference-checker \ 25 + $(OCAMLRUN) ./cross-reference-checker \ 27 26 -auxfile $(MANUAL)/texstuff/manual.aux \ 28 27 $(ROOTDIR)/utils/warnings.ml \ 29 28 $(ROOTDIR)/driver/main_args.ml \
-1
manual/tools/.gitignore
··· 1 1 transf.ml 2 2 texquote2 3 - htmltransf.ml 4 3 transf 5 4 htmlgen 6 5 htmlquote
+3 -3
manual/tools/Makefile
··· 9 9 all: texquote2 transf 10 10 11 11 12 - transf: transf.cmo htmltransf.cmo transfmain.cmo 12 + transf: transf.cmo transfmain.cmo 13 13 $(OCAMLC) $(COMPFLAGS) -o $@ -g $^ 14 14 15 - transfmain.cmo: transf.cmo htmltransf.cmo 15 + transfmain.cmo: transf.cmo 16 16 17 17 texquote2: texquote2.ml 18 18 $(OCAMLC) $(COMPFLAGS) -o $@ $< ··· 25 25 .PHONY: clean 26 26 clean: 27 27 rm -f *.o *.cm? *.cmx? 28 - rm -f transf.ml htmltransf.ml 28 + rm -f transf.ml 29 29 rm -f texquote2 transf
-117
manual/tools/htmltransf.mll
··· 1 - { 2 - open Lexing;; 3 - 4 - let need_space = 5 - ref false;; 6 - 7 - let addspace () = 8 - if !need_space then begin print_char ' '; need_space := false end;; 9 - } 10 - 11 - rule main = parse 12 - "\\begin{syntax}" { 13 - print_string "\\begin{rawhtml}\n<PRE>\n"; 14 - need_space := false; 15 - syntax lexbuf; 16 - print_string "</PRE>\n\\end{rawhtml}\n"; 17 - main lexbuf } 18 - | "\\@" { 19 - print_string "@"; 20 - main lexbuf } 21 - | "@" { 22 - print_string "%\n\\begin{rawhtml}"; 23 - need_space := false; 24 - syntax lexbuf; 25 - print_string "\\end{rawhtml}%\n"; 26 - main lexbuf } 27 - | _ { 28 - print_char (lexeme_char lexbuf 0); main lexbuf } 29 - | eof { 30 - () } 31 - 32 - and syntax = parse 33 - "\\end{syntax}" { () } 34 - | "@" { () } 35 - | '\'' { 36 - addspace(); 37 - print_string "<font color=\"blue\"><code>"; 38 - inquote lexbuf; 39 - print_string "</code></font>"; 40 - need_space := true; 41 - syntax lexbuf } 42 - | '\"' { 43 - addspace(); 44 - print_string "<font color=\"blue\"><code>"; 45 - indoublequote lexbuf; 46 - print_string "</code></font>"; 47 - need_space := true; 48 - syntax lexbuf } 49 - | ['a'-'z'] ['a'-'z' '0'-'9' '-'] * { 50 - addspace(); 51 - print_string "<i>"; 52 - print_string (lexeme lexbuf); 53 - print_string "</i>"; 54 - need_space := true; 55 - syntax lexbuf } 56 - | '\\' ['a'-'z''A'-'Z'] + { 57 - begin match lexeme lexbuf with 58 - "\\ldots" -> print_string "..."; need_space := false 59 - | s -> Printf.eprintf "Warning: %s ignored.\n" s 60 - end; 61 - syntax lexbuf } 62 - | '_' _ { 63 - print_string "<SUB>"; 64 - print_char(lexeme_char lexbuf 1); 65 - print_string "</SUB>"; 66 - syntax lexbuf } 67 - | '^' _ { 68 - print_string "<SUP>"; 69 - print_char(lexeme_char lexbuf 1); 70 - print_string "</SUP>"; 71 - syntax lexbuf } 72 - | ":" { 73 - print_string ":\n "; 74 - need_space := false; 75 - syntax lexbuf } 76 - | "|" { 77 - print_string "\n | "; 78 - need_space := false; 79 - syntax lexbuf } 80 - | ";" { 81 - print_string "\n\n"; 82 - need_space := false; 83 - syntax lexbuf } 84 - | [ '{' '[' '('] { 85 - addspace(); print_string (lexeme lexbuf); syntax lexbuf } 86 - | [ '}' ']' ')'] { 87 - print_string (lexeme lexbuf); syntax lexbuf } 88 - | "{{" { 89 - addspace(); print_string "{"; syntax lexbuf } 90 - | "}}" { 91 - print_string "}+"; syntax lexbuf } 92 - | "||" { 93 - print_string " | "; need_space := false; syntax lexbuf } 94 - | [ ' ' '\n' '\t' '~'] { 95 - syntax lexbuf } 96 - | [ ',' ] { 97 - print_char(lexeme_char lexbuf 0); syntax lexbuf } 98 - | _ { 99 - Printf.eprintf "Warning: %s ignored at char %d.\n" 100 - (lexeme lexbuf) (lexeme_start lexbuf); 101 - syntax lexbuf } 102 - 103 - and inquote = parse 104 - '\'' { () } 105 - | '&' { print_string "&amp;"; inquote lexbuf } 106 - | '<' { print_string "&lt;"; inquote lexbuf } 107 - | '>' { print_string "&gt;"; inquote lexbuf } 108 - | _ { print_char (lexeme_char lexbuf 0); inquote lexbuf } 109 - 110 - and indoublequote = parse 111 - '"' { () } 112 - | '&' { print_string "&amp;"; indoublequote lexbuf } 113 - | '<' { print_string "&lt;"; indoublequote lexbuf } 114 - | '>' { print_string "&gt;"; indoublequote lexbuf } 115 - | _ { print_char (lexeme_char lexbuf 0); indoublequote lexbuf } 116 - 117 -
+1 -3
manual/tools/transfmain.ml
··· 1 1 let main() = 2 2 let lexbuf = Lexing.from_channel stdin in 3 - if Array.length Sys.argv >= 2 && Sys.argv.(1) = "-html" 4 - then Htmltransf.main lexbuf 5 - else Transf.main lexbuf; 3 + Transf.main lexbuf; 6 4 exit 0;; 7 5 8 6 Printexc.print main ();;
+20 -2
otherlibs/systhreads/thread.ml
··· 34 34 35 35 let[@inline never] check_memprof_cb () = ref () 36 36 37 + let default_uncaught_exception_handler = thread_uncaught_exception 38 + 39 + let uncaught_exception_handler = ref default_uncaught_exception_handler 40 + 41 + let set_uncaught_exception_handler fn = uncaught_exception_handler := fn 42 + 37 43 let create fn arg = 38 44 thread_new 39 45 (fun () -> ··· 41 47 fn arg; 42 48 ignore (Sys.opaque_identity (check_memprof_cb ())) 43 49 with exn -> 44 - flush stdout; flush stderr; 45 - thread_uncaught_exception exn) 50 + let raw_backtrace = Printexc.get_raw_backtrace () in 51 + flush stdout; flush stderr; 52 + try 53 + !uncaught_exception_handler exn 54 + with exn' -> 55 + Printf.eprintf 56 + "Thread %d killed on uncaught exception %s\n" 57 + (id (self ())) (Printexc.to_string exn); 58 + Printexc.print_raw_backtrace stderr raw_backtrace; 59 + Printf.eprintf 60 + "Thread %d uncaught exception handler raised %s\n" 61 + (id (self ())) (Printexc.to_string exn'); 62 + Printexc.print_backtrace stdout; 63 + flush stderr) 46 64 47 65 let exit () = 48 66 ignore (Sys.opaque_identity (check_memprof_cb ()));
+13
otherlibs/systhreads/thread.mli
··· 145 145 Signal handlers attached to the signals in [sigs] will not 146 146 be invoked. The signals [sigs] are expected to be blocked before 147 147 calling [wait_signal]. *) 148 + 149 + (** {1 Uncaught exceptions} *) 150 + 151 + val default_uncaught_exception_handler : exn -> unit 152 + (** [Thread.default_uncaught_exception_handler] will print the thread's id, 153 + exception and backtrace (if available). *) 154 + 155 + val set_uncaught_exception_handler : (exn -> unit) -> unit 156 + (** [Thread.set_uncaught_exception_handler fn] registers [fn] as the handler 157 + for uncaught exceptions. 158 + 159 + If the newly set uncaught exception handler raise an exception, 160 + {!default_uncaught_exception_handler} will be called. *)
+1 -1
parsing/parsetree.mli
··· 381 381 | Pexp_open of open_declaration * expression 382 382 (* M.(E) 383 383 let open M in E 384 - let! open M in E *) 384 + let open! M in E *) 385 385 | Pexp_letop of letop 386 386 (* let* P = E in E 387 387 let* P = E and* P = E in E *)
+9
runtime/caml/misc.h
··· 76 76 #define Noreturn 77 77 #endif 78 78 79 + /* Manually preventing inlining */ 80 + #if defined(__GNUC__) 81 + #define Caml_noinline __attribute__ ((noinline)) 82 + #elif defined(_MSC_VER) 83 + #define Caml_noinline __declspec(noinline) 84 + #else 85 + #define Caml_noinline 86 + #endif 87 + 79 88 /* Export control (to mark primitives and to handle Windows DLL) */ 80 89 81 90 #ifndef CAMLDLLIMPORT
+79 -54
runtime/signals_osdep.h
··· 65 65 66 66 #define RETURN_AFTER_STACK_OVERFLOW 67 67 68 + /****************** AMD64, Solaris x86 */ 69 + 70 + #elif defined(TARGET_amd64) && defined (SYS_solaris) 71 + 72 + #include <ucontext.h> 73 + 74 + #define DECLARE_SIGNAL_HANDLER(name) \ 75 + static void name(int sig, siginfo_t * info, ucontext_t * context) 76 + 77 + #define SET_SIGACT(sigact,name) \ 78 + sigact.sa_sigaction = (void (*)(int,siginfo_t *,void *)) (name); \ 79 + sigact.sa_flags = SA_SIGINFO 80 + 81 + typedef greg_t context_reg; 82 + #define CONTEXT_PC (context->uc_mcontext.gregs[REG_RIP]) 83 + #define CONTEXT_C_ARG_1 (context->uc_mcontext.gregs[REG_RDI]) 84 + #define CONTEXT_SP (context->uc_mcontext.gregs[REG_RSP]) 85 + #define CONTEXT_YOUNG_PTR (context->uc_mcontext.gregs[REG_R15]) 86 + #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr) 87 + 88 + /****************** AMD64, OpenBSD */ 89 + 90 + #elif defined(TARGET_amd64) && defined (SYS_openbsd) 91 + 92 + #define DECLARE_SIGNAL_HANDLER(name) \ 93 + static void name(int sig, siginfo_t * info, struct sigcontext * context) 94 + 95 + #define SET_SIGACT(sigact,name) \ 96 + sigact.sa_sigaction = (void (*)(int,siginfo_t *,void *)) (name); \ 97 + sigact.sa_flags = SA_SIGINFO 98 + 99 + #define CONTEXT_PC (context->sc_rip) 100 + #define CONTEXT_C_ARG_1 (context->sc_rdi) 101 + #define CONTEXT_SP (context->sc_rsp) 102 + #define CONTEXT_YOUNG_PTR (context->sc_r15) 103 + #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr) 104 + 105 + /****************** AMD64, NetBSD */ 106 + 107 + #elif defined(TARGET_amd64) && defined (SYS_netbsd) 108 + 109 + #include <ucontext.h> 110 + #define DECLARE_SIGNAL_HANDLER(name) \ 111 + static void name(int sig, siginfo_t * info, ucontext_t * context) 112 + 113 + #define SET_SIGACT(sigact,name) \ 114 + sigact.sa_sigaction = (void (*)(int,siginfo_t *,void *)) (name); \ 115 + sigact.sa_flags = SA_SIGINFO 116 + 117 + #define CONTEXT_PC (_UC_MACHINE_PC(context)) 118 + #define CONTEXT_C_ARG_1 (context->uc_mcontext.gregs[REG_RDI]) 119 + #define CONTEXT_SP (_UC_MACHINE_SP(context)) 120 + #define CONTEXT_YOUNG_PTR (context->uc_mcontext.gregs[REG_R15]) 121 + #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr) 122 + 68 123 /****************** ARM, Linux */ 69 124 70 125 #elif defined(TARGET_arm) && (defined(SYS_linux_eabi) \ ··· 102 157 typedef unsigned long context_reg; 103 158 #define CONTEXT_PC (context->uc_mcontext.pc) 104 159 #define CONTEXT_SP (context->uc_mcontext.sp) 105 - #define CONTEXT_EXCEPTION_POINTER (context->uc_mcontext.regs[26]) 160 + #define CONTEXT_C_ARG_1 (context->uc_mcontext.regs[0]) 106 161 #define CONTEXT_YOUNG_PTR (context->uc_mcontext.regs[27]) 107 162 #define CONTEXT_FAULTING_ADDRESS ((char *) context->uc_mcontext.fault_address) 108 163 109 - /****************** ARM64, FreeBSD */ 164 + #define RETURN_AFTER_STACK_OVERFLOW 110 165 111 - #elif defined(TARGET_arm64) && defined(SYS_freebsd) 166 + /****************** ARM64, MacOSX */ 167 + 168 + #elif defined(TARGET_arm64) && defined (SYS_macosx) 112 169 113 170 #include <sys/ucontext.h> 114 171 115 172 #define DECLARE_SIGNAL_HANDLER(name) \ 116 - static void name(int sig, siginfo_t * info, ucontext_t * context) 173 + static void name(int sig, siginfo_t * info, void * context) 117 174 118 175 #define SET_SIGACT(sigact,name) \ 119 - sigact.sa_sigaction = (void (*)(int,siginfo_t *,void *)) (name); \ 176 + sigact.sa_sigaction = (name); \ 120 177 sigact.sa_flags = SA_SIGINFO 121 178 122 - typedef unsigned long context_reg; 123 - #define CONTEXT_PC (context->uc_mcontext.mc_gpregs.gp_elr) 124 - #define CONTEXT_SP (context->uc_mcontext.mc_gpregs.gp_sp) 125 - #define CONTEXT_EXCEPTION_POINTER (context->uc_mcontext.mc_gpregs.gp_x[26]) 126 - #define CONTEXT_YOUNG_PTR (context->uc_mcontext.mc_gpregs.gp_x[27]) 179 + typedef unsigned long long context_reg; 180 + #define CONTEXT_STATE (((ucontext_t *)context)->uc_mcontext->__ss) 181 + #define CONTEXT_PC (CONTEXT_STATE.__pc) 182 + #define CONTEXT_SP (CONTEXT_STATE.__sp) 183 + #define CONTEXT_C_ARG_1 (CONTEXT_STATE.__x[0]) 184 + #define CONTEXT_YOUNG_PTR (CONTEXT_STATE.__x[27]) 127 185 #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr) 128 186 187 + #define RETURN_AFTER_STACK_OVERFLOW 129 188 130 - /****************** AMD64, Solaris x86 */ 189 + /****************** ARM64, FreeBSD */ 131 190 132 - #elif defined(TARGET_amd64) && defined (SYS_solaris) 191 + #elif defined(TARGET_arm64) && defined(SYS_freebsd) 133 192 134 - #include <ucontext.h> 193 + #include <sys/ucontext.h> 135 194 136 195 #define DECLARE_SIGNAL_HANDLER(name) \ 137 196 static void name(int sig, siginfo_t * info, ucontext_t * context) 138 197 139 198 #define SET_SIGACT(sigact,name) \ 140 - sigact.sa_sigaction = (void (*)(int,siginfo_t *,void *)) (name); \ 141 - sigact.sa_flags = SA_SIGINFO 199 + sigact.sa_sigaction = (void (*)(int,siginfo_t *,void *)) (name); \ 200 + sigact.sa_flags = SA_SIGINFO 142 201 143 - typedef greg_t context_reg; 144 - #define CONTEXT_PC (context->uc_mcontext.gregs[REG_RIP]) 145 - #define CONTEXT_C_ARG_1 (context->uc_mcontext.gregs[REG_RDI]) 146 - #define CONTEXT_SP (context->uc_mcontext.gregs[REG_RSP]) 147 - #define CONTEXT_YOUNG_PTR (context->uc_mcontext.gregs[REG_R15]) 202 + typedef unsigned long context_reg; 203 + #define CONTEXT_PC (context->uc_mcontext.mc_gpregs.gp_elr) 204 + #define CONTEXT_SP (context->uc_mcontext.mc_gpregs.gp_sp) 205 + #define CONTEXT_EXCEPTION_POINTER (context->uc_mcontext.mc_gpregs.gp_x[26]) 206 + #define CONTEXT_YOUNG_PTR (context->uc_mcontext.mc_gpregs.gp_x[27]) 148 207 #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr) 149 208 150 - /****************** AMD64, OpenBSD */ 151 - 152 - #elif defined(TARGET_amd64) && defined (SYS_openbsd) 153 - 154 - #define DECLARE_SIGNAL_HANDLER(name) \ 155 - static void name(int sig, siginfo_t * info, struct sigcontext * context) 156 - 157 - #define SET_SIGACT(sigact,name) \ 158 - sigact.sa_sigaction = (void (*)(int,siginfo_t *,void *)) (name); \ 159 - sigact.sa_flags = SA_SIGINFO 160 - 161 - #define CONTEXT_PC (context->sc_rip) 162 - #define CONTEXT_C_ARG_1 (context->sc_rdi) 163 - #define CONTEXT_SP (context->sc_rsp) 164 - #define CONTEXT_YOUNG_PTR (context->sc_r15) 165 - #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr) 166 - 167 - /****************** AMD64, NetBSD */ 168 - 169 - #elif defined(TARGET_amd64) && defined (SYS_netbsd) 170 - 171 - #include <ucontext.h> 172 - #define DECLARE_SIGNAL_HANDLER(name) \ 173 - static void name(int sig, siginfo_t * info, ucontext_t * context) 174 - 175 - #define SET_SIGACT(sigact,name) \ 176 - sigact.sa_sigaction = (void (*)(int,siginfo_t *,void *)) (name); \ 177 - sigact.sa_flags = SA_SIGINFO 178 - 179 - #define CONTEXT_PC (_UC_MACHINE_PC(context)) 180 - #define CONTEXT_C_ARG_1 (context->uc_mcontext.gregs[REG_RDI]) 181 - #define CONTEXT_SP (_UC_MACHINE_SP(context)) 182 - #define CONTEXT_YOUNG_PTR (context->uc_mcontext.gregs[REG_R15]) 183 - #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr) 184 209 185 210 /****************** I386, Linux */ 186 211
+3 -5
stdlib/Makefile
··· 200 200 stdlib.cmxa: $(OBJS:.cmo=.cmx) 201 201 $(CAMLOPT) -a -o $@ $^ 202 202 203 - sys.ml: $(ROOTDIR)/VERSION sys.mlp 204 - sed -e "s|%%VERSION%%|`sed -e 1q $< | tr -d '\r'`|" sys.mlp > $@ 205 - 206 - .PHONY: clean 207 - clean:: 203 + .PHONY: distclean 204 + distclean: clean 208 205 rm -f sys.ml 209 206 207 + .PHONY: clean 210 208 clean:: 211 209 rm -f $(CAMLHEADERS) 212 210
-8
stdlib/dune
··· 27 27 (run awk -f %{dep:expand_module_aliases.awk} %{input-file})) 28 28 stdlib) 29 29 ))) 30 - 31 - (rule 32 - (targets sys.ml) 33 - (deps (:version ../VERSION) (:p sys.mlp)) 34 - (action 35 - (with-stdout-to %{targets} 36 - (bash 37 - "sed -e \"s|%%VERSION%%|`sed -e 1q %{version} | tr -d '\r'`|\" %{p}"))))
+3 -6
stdlib/sys.mlp stdlib/sys.ml.in
··· 1 - #2 "stdlib/sys.mlp" 1 + (* @configure_input@ *) 2 + #2 "stdlib/sys.ml.in" 2 3 (**************************************************************************) 3 4 (* *) 4 5 (* OCaml *) ··· 13 14 (* special exception on linking described in the file LICENSE. *) 14 15 (* *) 15 16 (**************************************************************************) 16 - 17 - (* WARNING: sys.ml is generated from sys.mlp. DO NOT EDIT sys.ml or 18 - your changes will be lost. 19 - *) 20 17 21 18 type backend_type = 22 19 | Native ··· 128 125 129 126 (* The version string is found in file ../VERSION *) 130 127 131 - let ocaml_version = "%%VERSION%%" 128 + let ocaml_version = "@VERSION@" 132 129 133 130 (* Optimization *) 134 131
+11 -2
testsuite/Makefile
··· 17 17 18 18 BASEDIR := $(shell pwd) 19 19 20 - FIND=find 21 20 ROOTDIR = .. 22 21 include $(ROOTDIR)/Makefile.common 22 + 23 + ifeq "$(UNIX_OR_WIN32)" "win32" 24 + CYGPATH=cygpath -m 25 + # Ensure that the test runners definitely use Cygwin's sort and not the 26 + # Windows sort command 27 + SORT=/usr/bin/sort 28 + else 29 + CYGPATH=echo 30 + SORT=sort 31 + endif 23 32 24 33 BASEDIR_HOST := $(shell $(CYGPATH) "$(BASEDIR)") 25 34 ROOTDIR_HOST := $(BASEDIR_HOST)/$(ROOTDIR) ··· 335 344 @$(MAKE) -C lib clean 336 345 @cd tools && $(MAKE) BASEDIR=$(BASEDIR) clean 337 346 @rm -f disabled-dirs 338 - $(FIND) . -name '*_ocamltest*' | xargs rm -rf 347 + find . -name '*_ocamltest*' | xargs rm -rf 339 348 rm -f $(failstamp) 340 349 341 350 .PHONY: report
+13 -22
testsuite/tests/asmgen/main.c
··· 17 17 #include <stdio.h> 18 18 #include <stdlib.h> 19 19 #include <time.h> 20 - #include <caml/mlvalues.h> 21 - 22 - /* This stub isn't needed for msvc32, since it's already in asmgen_i386nt.asm */ 23 - #if !defined(_MSC_VER) || !defined(_M_IX86) 24 - void caml_call_gc() 25 - { 26 - 27 - } 28 - #endif 29 20 30 21 /* This stub isn't needed for msvc32, since it's already in asmgen_i386nt.asm */ 31 22 #if !defined(_MSC_VER) || !defined(_M_IX86) ··· 74 65 75 66 #endif 76 67 77 - CAMLprim value run_prog(value varg1, value varg2, value varg3) 68 + int main(int argc, char **argv) 78 69 { 79 - long arg1 = Long_val(varg1); 80 - long arg2 = Long_val(varg2); 81 - long arg3 = Long_val(varg3); 82 - if (arg1+arg2+arg3) {}; /* squash unused var warnings */ 83 70 #ifdef UNIT_INT 84 71 { extern long FUN(void); 85 72 extern long call_gen_code(long (*)(void)); 86 73 printf("%ld\n", call_gen_code(FUN)); 87 74 } 88 75 #else 76 + if (argc < 2) { 77 + fprintf(stderr, "Usage: %s [int arg]\n", argv[0]); 78 + exit(2); 79 + } 89 80 #ifdef INT_INT 90 81 { extern long FUN(long); 91 82 extern long call_gen_code(long (*)(long), long); 92 - printf("%ld\n", call_gen_code(FUN, arg1)); 83 + printf("%ld\n", call_gen_code(FUN, atoi(argv[1]))); 93 84 } 94 85 #endif 95 86 #ifdef INT_FLOAT 96 87 { extern double FUN(long); 97 88 extern double call_gen_code(double (*)(long), long); 98 - printf("%f\n", call_gen_code(FUN, arg1)); 89 + printf("%f\n", call_gen_code(FUN, atoi(argv[1]))); 99 90 } 100 91 #endif 101 92 #ifdef FLOAT_CATCH ··· 113 104 long * a, * b; 114 105 long i; 115 106 116 - srand(arg2 ? arg2 : time(0)); 117 - n = arg1; 107 + srand(argc >= 3 ? atoi(argv[2]) : time((time_t *) 0)); 108 + n = atoi(argv[1]); 118 109 a = (long *) malloc(n * sizeof(long)); 119 110 for (i = 0 ; i < n; i++) a[i] = rand() & 0xFFF; 120 111 #ifdef DEBUG ··· 138 129 { extern void checkbound1(long), checkbound2(long, long); 139 130 extern void call_gen_code(void *, ...); 140 131 long x, y; 141 - x = arg1; 142 - if (arg2) { 143 - y = arg2; 132 + x = atoi(argv[1]); 133 + if (argc >= 3) { 134 + y = atoi(argv[2]); 144 135 if ((unsigned long) x < (unsigned long) y) 145 136 printf("Should not trap\n"); 146 137 else ··· 156 147 printf("OK\n"); 157 148 } 158 149 #endif 159 - return Val_unit; 150 + return 0; 160 151 }
+1 -1
testsuite/tests/backtrace/callstack.reference
··· 12 12 Called from Callstack.f1 in file "callstack.ml", line 12, characters 27-32 13 13 Called from Callstack.f2 in file "callstack.ml", line 13, characters 27-32 14 14 Called from Callstack.f3 in file "callstack.ml", line 14, characters 27-32 15 - Called from Thread.create.(fun) in file "thread.ml", line 41, characters 8-14 15 + Called from Thread.create.(fun) in file "thread.ml", line 47, characters 8-14
+37
testsuite/tests/lib-threads/uncaught_exception_handler.ml
··· 1 + (* TEST 2 + 3 + flags = "-g" 4 + ocamlrunparam += ",b=1" 5 + 6 + * hassysthreads 7 + include systhreads 8 + ** bytecode 9 + ** native 10 + 11 + *) 12 + 13 + (* Testing if uncaught exception handlers are behaving properly *) 14 + 15 + let () = Printexc.record_backtrace true 16 + 17 + exception UncaughtHandlerExn 18 + exception CallbackExn 19 + 20 + let handler exn = 21 + let id = Thread.self () |> Thread.id in 22 + let msg = Printexc.to_string exn in 23 + Printf.eprintf "[thread %d] caught %s\n" id msg; 24 + Printexc.print_backtrace stderr; 25 + flush stderr; 26 + raise UncaughtHandlerExn 27 + 28 + let fn () = Printexc.raise_with_backtrace 29 + CallbackExn 30 + (Printexc.get_raw_backtrace ()) 31 + 32 + let _ = 33 + let th = Thread.create fn () in 34 + Thread.join th; 35 + Thread.set_uncaught_exception_handler handler; 36 + let th = Thread.create fn () in 37 + Thread.join th
+12
testsuite/tests/lib-threads/uncaught_exception_handler.reference
··· 1 + Thread 1 killed on uncaught exception Uncaught_exception_handler.CallbackExn 2 + Raised at Uncaught_exception_handler.fn in file "uncaught_exception_handler.ml", line 28, characters 12-113 3 + Called from Thread.create.(fun) in file "thread.ml", line 47, characters 8-14 4 + [thread 2] caught Uncaught_exception_handler.CallbackExn 5 + Raised at Uncaught_exception_handler.fn in file "uncaught_exception_handler.ml", line 28, characters 12-113 6 + Called from Thread.create.(fun) in file "thread.ml", line 47, characters 8-14 7 + Thread 2 killed on uncaught exception Uncaught_exception_handler.CallbackExn 8 + Raised at Uncaught_exception_handler.fn in file "uncaught_exception_handler.ml", line 28, characters 12-113 9 + Called from Thread.create.(fun) in file "thread.ml", line 47, characters 8-14 10 + Thread 2 uncaught exception handler raised Uncaught_exception_handler.UncaughtHandlerExn 11 + Raised at Uncaught_exception_handler.handler in file "uncaught_exception_handler.ml", line 26, characters 2-26 12 + Called from Thread.create.(fun) in file "thread.ml", line 53, characters 10-41
+9
testsuite/tests/load_path/test.ml
··· 1 + (* TEST 2 + 3 + subdirectories = "test" 4 + 5 + * setup-ocaml-build-env 6 + ** ocaml 7 + test_file = "test/driver.ml" 8 + ocaml_script_as_argument = "true" 9 + *)
+3
testsuite/tests/load_path/test/driver.ml
··· 1 + #cd "test" 2 + #directory "." 3 + #use "payload.ml"
+1
testsuite/tests/load_path/test/payload.ml
··· 1 + let _ = 42
+17
testsuite/tests/prim-revapply/apply.ml
··· 42 42 (* PR#10081 *) 43 43 let bump ?(cap = 100) x = min cap (x + 1) 44 44 let _f x = bump @@ x (* no warning 48 *) 45 + 46 + (* Abstract functions *) 47 + let _ = 48 + let module A:sig 49 + type f 50 + type x 51 + val succ: f 52 + val zero:x 53 + external (@@): f -> x -> int = "%apply" 54 + end = struct 55 + type f = int -> int 56 + type x = int 57 + let succ = succ 58 + let zero = 0 59 + external (@@): f -> x -> int = "%apply" 60 + end in 61 + A.(succ @@ zero)
+17
testsuite/tests/prim-revapply/revapply.ml
··· 30 30 type t = A | B 31 31 type s = A | B 32 32 let _f (x : t) = x |> function A -> 0 | B -> 1 33 + 34 + (* Abstract functions *) 35 + let _ = 36 + let module A:sig 37 + type f 38 + type x 39 + val succ: f 40 + val zero:x 41 + external (|>): x -> f -> int = "%revapply" 42 + end = struct 43 + type f = int -> int 44 + type x = int 45 + let succ = succ 46 + let zero = 0 47 + external (|>): x -> f -> int = "%revapply" 48 + end in 49 + A.(zero |> succ)
+1 -1
tools/ci/appveyor/appveyor_build.sh
··· 70 70 dep='--disable-dependency-generation' 71 71 ;; 72 72 msvc64) 73 - build='--build=x86_64-unknown-cygwin' 73 + build='--build=x86_64-pc-cygwin' 74 74 host='--host=x86_64-pc-windows' 75 75 # Explicitly test dependency generation on msvc64 76 76 dep='--enable-dependency-generation'
+2 -2
tools/ci/inria/bootstrap/script
··· 160 160 check_make_alldepend=true 161 161 ;; 162 162 mingw64) 163 - build='--build=x86_64-unknown-cygwin' 163 + build='--build=x86_64-pc-cygwin' 164 164 host='--host=x86_64-w64-mingw32' 165 165 instdir='C:/ocamlmgw64' 166 166 cleanup=true ··· 174 174 cleanup=true 175 175 ;; 176 176 msvc64) 177 - build='--build=x86_64-unknown-cygwin' 177 + build='--build=x86_64-pc-cygwin' 178 178 host='--host=x86_64-pc-windows' 179 179 instdir='C:/ocamlms64' 180 180 configure=nt
+2 -2
tools/ci/inria/main
··· 171 171 check_make_alldepend=true 172 172 ;; 173 173 mingw64) 174 - build='--build=x86_64-unknown-cygwin' 174 + build='--build=x86_64-pc-cygwin' 175 175 host='--host=x86_64-w64-mingw32' 176 176 instdir='C:/ocamlmgw64' 177 177 cleanup=true ··· 184 184 cleanup=true 185 185 ;; 186 186 msvc64) 187 - build='--build=x86_64-unknown-cygwin' 187 + build='--build=x86_64-pc-cygwin' 188 188 host='--host=x86_64-pc-windows' 189 189 instdir='C:/ocamlms64' 190 190 cleanup=true
+1 -1
toplevel/topdirs.ml
··· 77 77 let d = expand_directory Config.standard_library s in 78 78 Dll.add_path [d]; 79 79 let dir = Load_path.Dir.create d in 80 - Load_path.add dir; 80 + Load_path.prepend_dir dir; 81 81 toplevel_env := 82 82 Stdlib.String.Set.fold 83 83 (fun name env ->
+34 -4
typing/typecore.ml
··· 2742 2742 | Pexp_ifthenelse (_, e1, Some e2) -> is_inferred e1 && is_inferred e2 2743 2743 | _ -> false 2744 2744 2745 + (* check if the type of %apply or %revapply matches the type expected by 2746 + the specialized typing rule for those primitives. 2747 + *) 2748 + type apply_prim = 2749 + | Apply 2750 + | Revapply 2751 + let check_apply_prim_type prim typ = 2752 + match get_desc typ with 2753 + | Tarrow (Nolabel,a,b,_) -> 2754 + begin match get_desc b with 2755 + | Tarrow(Nolabel,c,d,_) -> 2756 + let f, x, res = 2757 + match prim with 2758 + | Apply -> a, c, d 2759 + | Revapply -> c, a, d 2760 + in 2761 + begin match get_desc f with 2762 + | Tarrow(Nolabel,fl,fr,_) -> 2763 + is_Tvar fl && is_Tvar fr && is_Tvar x && is_Tvar res 2764 + && Types.eq_type fl x && Types.eq_type fr res 2765 + | _ -> false 2766 + end 2767 + | _ -> false 2768 + end 2769 + | _ -> false 2770 + 2745 2771 (* Merge explanation to type clash error *) 2746 2772 2747 2773 let with_explanation explanation f = ··· 2947 2973 let funct, sargs = 2948 2974 let funct = type_sfunct sfunct in 2949 2975 match funct.exp_desc, sargs with 2950 - | Texp_ident (_, _, {val_kind = Val_prim {prim_name = "%revapply"}}), 2976 + | Texp_ident (_, _, 2977 + {val_kind = Val_prim {prim_name="%revapply"}; val_type}), 2951 2978 [Nolabel, sarg; Nolabel, actual_sfunct] 2952 - when is_inferred actual_sfunct -> 2979 + when is_inferred actual_sfunct 2980 + && check_apply_prim_type Revapply val_type -> 2953 2981 type_sfunct actual_sfunct, [Nolabel, sarg] 2954 - | Texp_ident (_, _, {val_kind = Val_prim {prim_name = "%apply"}}), 2955 - [Nolabel, actual_sfunct; Nolabel, sarg] -> 2982 + | Texp_ident (_, _, 2983 + {val_kind = Val_prim {prim_name="%apply"}; val_type}), 2984 + [Nolabel, actual_sfunct; Nolabel, sarg] 2985 + when check_apply_prim_type Apply val_type -> 2956 2986 type_sfunct actual_sfunct, [Nolabel, sarg] 2957 2987 | _ -> 2958 2988 funct, sargs
+1
utils/Makefile
··· 79 79 $(call SUBST,FORCE_SAFE_STRING) \ 80 80 $(call SUBST,DEFAULT_SAFE_STRING) \ 81 81 $(call SUBST,WINDOWS_UNICODE) \ 82 + $(call SUBST,NAKED_POINTERS) \ 82 83 $(call SUBST,SUPPORTS_SHARED_LIBRARIES) \ 83 84 $(call SUBST,SYSTEM) \ 84 85 $(call SUBST,SYSTHREAD_SUPPORT) \
+5
utils/config.mli
··· 244 244 val windows_unicode: bool 245 245 (** Whether Windows Unicode runtime is enabled *) 246 246 247 + val naked_pointers : bool 248 + (** Whether the runtime supports naked pointers 249 + 250 + @since 4.14.0 *) 251 + 247 252 val supports_shared_libraries: bool 248 253 (** Whether shared libraries are supported 249 254
+2
utils/config.mlp
··· 84 84 let safe_string = %%FORCE_SAFE_STRING%% 85 85 let default_safe_string = %%DEFAULT_SAFE_STRING%% 86 86 let windows_unicode = %%WINDOWS_UNICODE%% != 0 87 + let naked_pointers = %%NAKED_POINTERS%% 87 88 let force_instrumented_runtime = %%FORCE_INSTRUMENTED_RUNTIME%% 88 89 89 90 let flat_float_array = %%FLAT_FLOAT_ARRAY%% ··· 204 205 p_bool "afl_instrument" afl_instrument; 205 206 p_bool "windows_unicode" windows_unicode; 206 207 p_bool "supports_shared_libraries" supports_shared_libraries; 208 + p_bool "naked_pointers" naked_pointers; 207 209 208 210 p "exec_magic_number" exec_magic_number; 209 211 p "cmi_magic_number" cmi_magic_number;
+12 -3
utils/load_path.ml
··· 59 59 we are starting from an empty cache, we can avoid checking whether a unit 60 60 name already exists in the cache simply by adding entries in reverse 61 61 order. *) 62 - let add dir = 62 + let prepend_add dir = 63 63 List.iter (fun base -> 64 64 let fn = Filename.concat dir.Dir.path base in 65 65 STbl.replace !files base fn; ··· 69 69 let init l = 70 70 reset (); 71 71 dirs := List.rev_map Dir.create l; 72 - List.iter add !dirs 72 + List.iter prepend_add !dirs 73 73 74 74 let remove_dir dir = 75 75 assert (not Config.merlin || Local_store.is_bound ()); 76 76 let new_dirs = List.filter (fun d -> Dir.path d <> dir) !dirs in 77 77 if List.compare_lengths new_dirs !dirs <> 0 then begin 78 78 reset (); 79 - List.iter add new_dirs; 79 + List.iter prepend_add new_dirs; 80 80 dirs := new_dirs 81 81 end 82 82 ··· 95 95 STbl.replace !files_uncap ubase fn) 96 96 dir.Dir.files; 97 97 dirs := dir :: !dirs 98 + 99 + let append_dir = add 98 100 99 101 let add_dir dir = add (Dir.create dir) 102 + 103 + (* Add the directory at the start of load path - so basenames are 104 + unconditionally added. *) 105 + let prepend_dir dir = 106 + assert (not Config.merlin || Local_store.is_bound ()); 107 + prepend_add dir; 108 + dirs := !dirs @ [dir] 100 109 101 110 let is_basename fn = Filename.basename fn = fn 102 111
+11 -2
utils/load_path.mli
··· 23 23 *) 24 24 25 25 val add_dir : string -> unit 26 - (** Add a directory to the load path *) 26 + (** Add a directory to the end of the load path (i.e. at lowest priority.) *) 27 27 28 28 val remove_dir : string -> unit 29 29 (** Remove a directory from the load path *) ··· 60 60 sub-directories of this directory. *) 61 61 end 62 62 63 - val add : Dir.t -> unit 63 + val[@deprecated] add : Dir.t -> unit 64 + (** Old name for {!append_dir} *) 65 + 66 + val append_dir : Dir.t -> unit 67 + (** [append_dir d] adds [d] to the end of the load path (i.e. at lowest 68 + priority. *) 69 + 70 + val prepend_dir : Dir.t -> unit 71 + (** [prepend_dir d] adds [d] to the start of the load path (i.e. at highest 72 + priority. *) 64 73 65 74 val get : unit -> Dir.t list 66 75 (** Same as [get_paths ()], except that it returns a [Dir.t list]. *)