From df45642d06530bdf634ae569f63769905779f4e3e3d76ba25ff48469a88bfa62 Mon Sep 17 00:00:00 2001 From: Soc Virnyl Estela Date: Tue, 16 Jul 2024 15:38:34 +0000 Subject: [PATCH] - Update to version 0.24.2: * check: Handle error expressions in offset() * Clean up includes * expr_hash: Handle STORAGE_ERROR case * check: Handle error in bindings of for-accumulator * expr_hash: Remove unnecessary alias check * Disallow casting types of undefined size * typedef: Emit struct literals * Remove unused gen_context.store * eval: Disallow auto-dereferencing * typedef: Handle values of enums with rune storage * eval: Implement slicing expressions * parse: simplify nested switch * parse: Remove unnecessary special-case from parse_if_expression * drop some "descriptive" names in generated IL * makefiles/tests.mk: make everything depend on harec * check: drop check of for_expr binding result type * gen_expr_delete: split single element/subslice cases * remove a use of *void in tests * simplify condition in identifier_eq * gen: implement gen_slice_ptrs and load_slice_data helpers * check: rewrite slice_bounds_check * eval: fix and add tests for casts from tagged unions * check: lower len(array) to a constant * gen: remove another overly verbose temporary name * remove useless line * check_expr_compound: simplify lower_implicit_cast logic * type_store: fix tuple size calculation * eval: use restrict keyword * type_store: simplify function signatures in struct initialization * test some embedded struct error cases * use arch specific sizes from ctx->arch consistently * gen: rewrite slice bounds checks * gen_expr_assign_slice: use gen_subslice_info * gen_expr_delete: use gen_subslice_info * test functions with bodies have named parameters * gen: rewrite expandable array -> slice assignment * gen: use store_slice_data instead of manual slice stores * type_store: return errors more explicitly in case of struct init errors * type_store: fix union size calculation * prohibit @packed in check, not in the parser * ast: split up slice and array atypes * ast: improve representation of array literal expandability * resolve: pass function location data into prototype check * util: simplify printing in errline() * eval: truncate bitwise not and integer unary negation results * check: improve binding assignability failure error * check: don't special case STORAGE_ERROR in check_function * check: drop pointless branch * gen: extract fixed_abort condition checks into a separate function * gen: rewrite slice and array alloc cases * check: rewrite check_expr_call * check: fix outdated comment about flexible promotion * tests: fix typo * Makefile: add uninstall target * check.c: fix up lingering issue from rename * Generate meaningful names for @init functions * Generate arbitrary names for @init functions * scripts/version: upgrade to 0.24.2 * fix some spurious errors * Allow optional parameters in variadic functions. * check: fix error location in check_expr_append_insert * 12-loops: fix scope test * implement for-each * rt::compile ensure tests fail when "invalid" Hare is valid * gen: fix implicitly void if false branch * parse: fix memory leak * eval: fix signed integer comparisons * check: remove TODO * Remove unnecessary forward declaration * lex: make comment more accurate * gen: s/strconst/strliteral/g * Makefile: recompile everything when a header changes * makefiles/tests.mk: make all tests depend on .cache/rt.td * typedef: fix some format specifiers * set TDENV when running tests * tests: rename 00-constants to 00-literals * util: ignore write errors to stderr * Check stage at which compilation failed in reject tests * tests/00-literals: s/append/static append/ * gen: fix for-each iterator with tagged union type * typedef: use const in more places * types: remove extraneous check * types: make unbounded arrays not assignable to slices * gen: remove gen_defers from gen_expr_for * main: remove unnecessary 'next' variable * mod: use string initializer instead of memcpy * parse: remove dead branch * parse: use error function for empty block error * check: fix measurement error locations * check: simplify switch exhaustivity checking * tests.mk: add missing testmod.td dependency * typedef: Remove unnecessary includings of "typedef.h" * lex: allow digit separators * Check that enums are exported if used in exported types. * Implement optional function parameters. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/harec?expand=0&rev=24 --- .gitattributes | 23 +++ .gitignore | 1 + README-suse-maint.md | 2 + harec-0.24.0.tar.gz | 3 + harec-0.24.2.tar.gz | 3 + harec.changes | 365 +++++++++++++++++++++++++++++++++++++++++++ harec.spec | 80 ++++++++++ 7 files changed, 477 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 README-suse-maint.md create mode 100644 harec-0.24.0.tar.gz create mode 100644 harec-0.24.2.tar.gz create mode 100644 harec.changes create mode 100644 harec.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/README-suse-maint.md b/README-suse-maint.md new file mode 100644 index 0000000..bfa910b --- /dev/null +++ b/README-suse-maint.md @@ -0,0 +1,2 @@ +Before submitting hare to Factory, **always submit harec first**. + diff --git a/harec-0.24.0.tar.gz b/harec-0.24.0.tar.gz new file mode 100644 index 0000000..a657c4f --- /dev/null +++ b/harec-0.24.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:add6a7c4cbfd130c5e9fcecd2d43bec39640ed9f9cfbe9166e4b7e945a46b7de +size 193534 diff --git a/harec-0.24.2.tar.gz b/harec-0.24.2.tar.gz new file mode 100644 index 0000000..80281df --- /dev/null +++ b/harec-0.24.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88b3961b236fbfe3a0dfb46bb954741fa5c031bbda6d07fbc238c98f0abb41a2 +size 201789 diff --git a/harec.changes b/harec.changes new file mode 100644 index 0000000..eb94211 --- /dev/null +++ b/harec.changes @@ -0,0 +1,365 @@ +------------------------------------------------------------------- +Tue Jul 16 14:20:43 UTC 2024 - Soc Virnyl Estela + +- Update to version 0.24.2: + * check: Handle error expressions in offset() + * Clean up includes + * expr_hash: Handle STORAGE_ERROR case + * check: Handle error in bindings of for-accumulator + * expr_hash: Remove unnecessary alias check + * Disallow casting types of undefined size + * typedef: Emit struct literals + * Remove unused gen_context.store + * eval: Disallow auto-dereferencing + * typedef: Handle values of enums with rune storage + * eval: Implement slicing expressions + * parse: simplify nested switch + * parse: Remove unnecessary special-case from parse_if_expression + * drop some "descriptive" names in generated IL + * makefiles/tests.mk: make everything depend on harec + * check: drop check of for_expr binding result type + * gen_expr_delete: split single element/subslice cases + * remove a use of *void in tests + * simplify condition in identifier_eq + * gen: implement gen_slice_ptrs and load_slice_data helpers + * check: rewrite slice_bounds_check + * eval: fix and add tests for casts from tagged unions + * check: lower len(array) to a constant + * gen: remove another overly verbose temporary name + * remove useless line + * check_expr_compound: simplify lower_implicit_cast logic + * type_store: fix tuple size calculation + * eval: use restrict keyword + * type_store: simplify function signatures in struct initialization + * test some embedded struct error cases + * use arch specific sizes from ctx->arch consistently + * gen: rewrite slice bounds checks + * gen_expr_assign_slice: use gen_subslice_info + * gen_expr_delete: use gen_subslice_info + * test functions with bodies have named parameters + * gen: rewrite expandable array -> slice assignment + * gen: use store_slice_data instead of manual slice stores + * type_store: return errors more explicitly in case of struct init errors + * type_store: fix union size calculation + * prohibit @packed in check, not in the parser + * ast: split up slice and array atypes + * ast: improve representation of array literal expandability + * resolve: pass function location data into prototype check + * util: simplify printing in errline() + * eval: truncate bitwise not and integer unary negation results + * check: improve binding assignability failure error + * check: don't special case STORAGE_ERROR in check_function + * check: drop pointless branch + * gen: extract fixed_abort condition checks into a separate function + * gen: rewrite slice and array alloc cases + * check: rewrite check_expr_call + * check: fix outdated comment about flexible promotion + * tests: fix typo + * Makefile: add uninstall target + * check.c: fix up lingering issue from rename + * Generate meaningful names for @init functions + * Generate arbitrary names for @init functions + * scripts/version: upgrade to 0.24.2 + * fix some spurious errors + * Allow optional parameters in variadic functions. + * check: fix error location in check_expr_append_insert + * 12-loops: fix scope test + * implement for-each + * rt::compile ensure tests fail when "invalid" Hare is valid + * gen: fix implicitly void if false branch + * parse: fix memory leak + * eval: fix signed integer comparisons + * check: remove TODO + * Remove unnecessary forward declaration + * lex: make comment more accurate + * gen: s/strconst/strliteral/g + * Makefile: recompile everything when a header changes + * makefiles/tests.mk: make all tests depend on .cache/rt.td + * typedef: fix some format specifiers + * set TDENV when running tests + * tests: rename 00-constants to 00-literals + * util: ignore write errors to stderr + * Check stage at which compilation failed in reject tests + * tests/00-literals: s/append/static append/ + * gen: fix for-each iterator with tagged union type + * typedef: use const in more places + * types: remove extraneous check + * types: make unbounded arrays not assignable to slices + * gen: remove gen_defers from gen_expr_for + * main: remove unnecessary 'next' variable + * mod: use string initializer instead of memcpy + * parse: remove dead branch + * parse: use error function for empty block error + * check: fix measurement error locations + * check: simplify switch exhaustivity checking + * tests.mk: add missing testmod.td dependency + * typedef: Remove unnecessary includings of "typedef.h" + * lex: allow digit separators + * Check that enums are exported if used in exported types. + * Implement optional function parameters. + +------------------------------------------------------------------- +Sat Feb 17 00:57:51 UTC 2024 - Soc Virnyl Estela + +- Update to release 0.24.0: + * first pre-release of harec + * requires qbe 1.2 + +------------------------------------------------------------------- +Sat Jan 20 07:21:00 UTC 2024 - Soc Virnyl Estela + +- Update to version 1704220143.770566a: + * gen: add column to dbgloc + * Check for STORAGE_ERROR before lowering Hare vaargs + * qtype: fix -Werror failures + * add .builds/openbsd.yml + * gen: move tagged value to first aligned offset + * OpenBSD: fix tests + * replace ./configure with config.mk + * fix confusing wording in parse.c +- Update specfile + * Adopt new makefile to new configs + +------------------------------------------------------------------- +Sat Dec 23 08:12:46 UTC 2023 - Soc Virnyl Estela + +- Set version environment variable in specfile + +------------------------------------------------------------------- +Sat Dec 16 01:01:49 UTC 2023 - socvirnyl.estela@gmail.com + +- Update to version 1702179030.9d51b36: + * scope: split up scope_lookup_ancestor + * Implement for labels + * Implement switch/match labels + * check: fix enum alias importing + * tests/34-declarations: add invalid symbol tests + * parse: disallow empty symbol + * type_store: fix tagged union segfault + * all: use literal/flexible in place of constant + * main: check for fmemopen error + * mod: remove unnecessary allocation + * tests: fix broken rejection tests + * type_store: make builtin_type_error have zero size/alignment + +------------------------------------------------------------------- +Fri Dec 8 14:26:25 UTC 2023 - Soc Virnyl Estela + +- Add README-suse-maint.md + +------------------------------------------------------------------- +Fri Dec 08 13:19:03 UTC 2023 - socvirnyl.estela@gmail.com + +- Update to version 1701558776.08af325: + * OpenBSD: Fix _start for arm64. + +------------------------------------------------------------------- +Sat Dec 02 10:16:07 UTC 2023 - socvirnyl.estela@gmail.com + +- Update to version 1701262234.ec3193e: + * types: recover from circular dependency error + * check,gen: use name instead of ident to create global_decl declarations + * Revert "types: recover from circular dependency error" + * types: recover from circular dependency error + * type_store: pass around check context + * type_store: detect duplicate fields in embedded structs/unions + * check: improve error message + * ast: make ast_enum_field name non-const + * all: use const for more function params + * scope: put type and value in a union + * rt, tests: drop EXIT_FAILURE + * check: resolve type when taking size/alignment + * check: replace expression_measure with expression_len + * check: allow taking alignment of zero-size type + * parse: add error function + * lex: use error func for unexpected codepoint error + * check: remove unnecessary memset + * parse: disallow casting to null + * Move func_decl_flags from check.h to ast.h + * parse: add missing va_ends + * main: use xfprintf with harec -v + * gen: use u32 instead of uint for tag + * check: allow freeing null + * qtype: fix memory leak + * check: disallow append/inserting with undefined-size member + * check: disallow unbounded array value in append/insert + * parse: disallow ellipsis in append/insert length form + * tests: make insert rejection tests consistent with append + * tests: fix append/insert rejection tests + * check: fix append/insert value dereferencing + * parse, check: update imports + * all: fix format specifiers + * check: be more picky about default values of arrays + * implement checkless for loops + +------------------------------------------------------------------- +Sat Nov 11 07:34:57 UTC 2023 - Soc Virnyl Estela + +- Improve specfile. Add some comments + +------------------------------------------------------------------- +Fri Nov 10 12:24:19 UTC 2023 - Soc Virnyl Estela + +- Update groups section in specfile + +------------------------------------------------------------------- +Fri Nov 10 06:33:21 UTC 2023 - Soc Virnyl Estela + +- Add install command. + +------------------------------------------------------------------- +Fri Nov 10 06:31:02 UTC 2023 - Soc Virnyl Estela + +- Dont pin version requirment on qbe + +------------------------------------------------------------------- +Fri Nov 10 04:12:11 UTC 2023 - socvirnyl.estela@gmail.com + +- Update to version 1699297758.b4dd427: + * parse: improve error message + * all: remove another spurious error + * check: recover from errors in resolve_type + * type_store: fix signed array length check + * gen.c: Fix warning which lets build fail + * Improve handling of invalid UTF-8 in rune/str literals + * check: make error msg more accurate + * Revert "convert redundant check to assert" + * Add zero-size bindings + * check: recover from errors in check_function + +------------------------------------------------------------------- +Sun Aug 20 15:04:21 UTC 2023 - Soc Virnyl Estela + +- Remove no-exec-stack.patch. Seems they use noexec stack already. + +------------------------------------------------------------------- +Sun Aug 20 14:57:42 UTC 2023 - Soc Virnyl Estela + +- Add no-exec-stack.patch + +------------------------------------------------------------------- +Sun Aug 20 14:42:43 UTC 2023 - Soc Virnyl Estela + +- Update to version 0+1630: + * fix type promotion with STORAGE_ERROR on the right + * link tests with -z noexecstack + * emit line number info + * identifier: use xrealloc instead of allocating new memory + * lex: remove pointless _lex function + * Return EXIT_SUCCESS when -h is used + * types: make tagged unions castable to invalid + * doc/runtime.txt: remove runtime behavior descriptions + * check: disallow initializing object with undefined size + * check: disallow assigning to object with undefined size + * Revert nested defers + * Remove cap built-in + * Remove accidentally added test + * check: handle errors without (ab)using type hints + * Revert "Implement new hosted environment requirements" + * Allow top-level static assertions + * Remove unary + + * check: disallow @symbol alongside other attributes + * check: disallow @init, @fini, and @test on prototypes + * Implement new hosted environment requirements + * docs: document NO_COLOR and HAREC_COLOR + * rt: pass raw compile flags to harec + * Make pointer/slice assignability rules more strict + * check: add implicit yield at end of compound expr + * Remove implicit const flag from function decls + * Remove cursed bool test + * check: show visual marker for all errors + * lex: add static assertion for tokens array length + * eval: fix abort when evaluating measure expr on ERROR + * Add cap builtin + * check: always perform result reduction on if expr + * parse: allow return and yield in more places + * tests: remove magic exit status from 09-funcs + * check: remove ctx->deferring + * check, gen: allow nested defers + * check: remove unnecessary defer check + * check: disallow jumping out of defer + * parse: fix import name list parsing + * Link with libm + +------------------------------------------------------------------- +Sun Aug 13 13:26:58 UTC 2023 - Soc Virnyl Estela + +- Replace obsoleted `disabled` option with `manual` + +------------------------------------------------------------------- +Sat Jul 22 14:21:45 UTC 2023 - Soc Virnyl Estela + +- Update to 0+1591: + * qbe: make offset field int64_t instead of long [f16e979] - Sebastian + * all: replace intmax_t with int64_t [18a73fb] - Sebastian + * drop expression parameter from error_norec [c1259f6] - Ember Sawady + * type_dealias: resolve incomplete aliases [506bd08] - Ember Sawady + * thread check context into type_dealias [8b17997] - Ember Sawady + * get rid of yet another spurious error [618f28b] - Ember Sawady + * type store: s/uint/u32/ for tagged union tags [c2e1ec3] - Ember Sawady + * avoid segfault on return with invalid parameters [0424adb] - Ember Sawady + * extend sub-word types before relevant bin/unarithms [f5da14c] - Ember Sawady + * Get rid of more spurious errors [89133d4] - Ember Sawady + * Rewrite malloc [7a27d96] - Ember Sawady + * rt: fix typo [174aef4] - Sebastian + * Add harec -v [a66a324] - Ember Sawady + * lex: make E and P in literals case-insensitive [efc9cc3] - Ember Sawady + * rt+freebsd: _start: don't touch first arg [d8db334] - Ember Sawady + * Emit an abort at the end of @noreturn functions [22e4ade] - Ember Sawady + * emit precise hexadecimal floats in typedef.c [8ea475e] - Bor Grošelj Simić + * implement hex float literals [0c77e6a] - Bor Grošelj Simić + * check: lower the failing case of ! to default match case [2ac0c5f] - Bor Grošelj Simić + * gen: utilize qbe's new hlt instruction [209ca85] - Bor Grošelj Simić + * Add missing comma in abort reasons [4718e74] - Ember Sawady + * gen: put all rt functions into a struct [609c0ca] - Bor Grošelj Simić + * check: no default value for enums without zero value [9b4c417] - Sebastian + * check: disallow autofilling fields without default values [189dfc9] - Sebastian + * gen: remove some obsolete utility functions [8917e4a] - Bor Grošelj Simić + * expr_propagate: make "error occured" a fixed abort [9632c11] - Bor Grošelj Simić + * allow assert/abort with non-constant message [f4ab18a] - Bor Grošelj Simić + * check: handle static assertions without passing them on [186f301] - Bor Grošelj Simić + * add a utility function for constant string exprs [d7231f6] - Bor Grošelj Simić + * all: add xfprintf function which exits for I/O errors [db642ac] - Sebastian + * Permit C-style variadism with no named params [cbe828e] - Sebastian + * docs/runtime.txt: document recently added fixed abort reason [16aa2bb] - Bor Grošelj Simić + * expr.h: remove unused struct expression_propagate [6afa5af] - Bor Grošelj Simić + * all: correct xcalloc argument order [b092fc5] - Sebastian + * Refactor typedef environment variables [dfc1dd1] - Ember Sawady + * eval_measurement: implement len for arrays [f12153b] - Umar Getagazov + * Allow empty -N option arg [9c4c5c7] - Autumn! + * error: Align located messages with other toolchains [7f5eb3f] - Dridi Boukelmoune + * Remove _ from function parameters. [01cb763] - Joe Finney + * Loosen uintptr promotion rules [9bf57f6] - Ember Sawady + * Drop HA_STAGE [72c917b] - Ember Sawady + * Remove char [3dfde59] - Sebastian + * Abort instead of SEGFAULT when slice alloc cap < length [a3b22ca] - Autumn! + * ensure operands and operators match in special assignment expressions [151a0a2] - Bor Grošelj Simić + * check: extract binop validity checking into a separate function [36868d0] - Bor Grošelj Simić + * Add more binarithms tests [aaf2c2f] - Sebastian + * eval: fix signed binarithm operations [76bf2d6] - Sebastian + * gen: correctly copy first member in expandable arrays [d436570] - Bor Grošelj Simić + +------------------------------------------------------------------- +Sat May 27 13:05:16 UTC 2023 - Soc Virnyl Estela + +- Update to 0+1562: + * all: add xfprintf function which exits for I/O errors + * permit C-style variadism with no named params + * docs/runtime.txt: document recently added fixed abort reason + * expr.h: remove unused struct expression_propagate + * all: correct xcalloc argument order + * Refactor typedef environment variables + * eval_measurement: implement len for arrays + * allow empty -N option arg + * error: align located messages with other toolchains + * Remove _ from function parameters. + +------------------------------------------------------------------- +Sat Mar 11 11:29:55 UTC 2023 - Soc Virnyl Estela + +- Enable test suite + +------------------------------------------------------------------- +Tue Feb 28 23:50:54 UTC 2023 - Soc Virnyl Estela + +- Initial spec for harec 0+git1514 diff --git a/harec.spec b/harec.spec new file mode 100644 index 0000000..89eb21b --- /dev/null +++ b/harec.spec @@ -0,0 +1,80 @@ +# +# spec file for package harec +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: harec +Release: 0 +Version: 0.24.2 +Summary: Bootstrap compiler for hare +Group: Development/Tools/Building +URL: https://git.sr.ht/~sircmpwn/harec +Source0: https://git.sr.ht/~sircmpwn/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source1: README-suse-maint.md +BuildRequires: make +BuildRequires: qbe = 1.2 +BuildRequires: zstd +License: GPL-3.0-only + +%description + +HareC is a bootstrap compiler for the Hare programming language. Written in C11 for +POSIX-compatible systems. + +%prep +%setup -q + +%build +cat > config.mk <<-SH +PREFIX = %{_prefix} +BINDIR = %{_bindir} + +PLATFORM = linux +ARCH = %{_arch} +HARECFLAGS = +QBEFLAGS = +ASFLAGS = +LDLINKFLAGS = --gc-sections -z noexecstack +CFLAGS = %{optflags} -Iinclude +LDFLAGS = +LIBS = -lm + +CC = cc +AS = as +LD = ld +QBE = qbe + +HARECACHE = .cache +BINOUT = .bin + +DEFAULT_TARGET = %{_arch} +VERSION = %{version} +SH + +make + +%install +make DESTDIR=%{buildroot} install + +%check +make check + +%files +%{_bindir}/%{name} +%license COPYING +%doc README.md + +%changelog