Skip to content

Commit 64f858f

Browse files
committed
all: master ci fixes
1 parent f919ee4 commit 64f858f

2 files changed

Lines changed: 34 additions & 14 deletions

File tree

‎GNUmakefile‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,16 @@ ifneq ($(CC),tcc)
168168
endif
169169
endif
170170
endif
171+
ifdef ANDROID
172+
ifneq ($(BOOTSTRAP_TCC_REQUESTED),)
173+
ifneq ($(CC),tcc)
174+
# There is no Android TCC bundle yet. If `-cc tcc` was requested anyway,
175+
# keep both bootstrap stages on the system compiler.
176+
BOOTSTRAP_VC_CCOMPILER_VFLAG := -cc "$(CC)"
177+
BOOTSTRAP_CCOMPILER_VFLAG := -cc "$(CC)"
178+
endif
179+
endif
180+
endif
171181
BOOTSTRAP_VC_VFLAGS := $(BOOTSTRAP_VC_CCOMPILER_VFLAG) $(if $(strip $(BOOTSTRAP_VC_CFLAGS)),-cflags "$(BOOTSTRAP_VC_CFLAGS)") $(if $(strip $(BOOTSTRAP_LDFLAGS)),-ldflags "$(BOOTSTRAP_LDFLAGS)")
172182
BOOTSTRAP_VFLAGS := $(BOOTSTRAP_CCOMPILER_VFLAG) $(if $(strip $(BOOTSTRAP_CFLAGS)),-cflags "$(BOOTSTRAP_CFLAGS)") $(if $(strip $(BOOTSTRAP_LDFLAGS)),-ldflags "$(BOOTSTRAP_LDFLAGS)")
173183

‎vlib/v/gen/c/coutput_test.v‎

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -658,15 +658,25 @@ fn test_array_sort_expression_key_avoids_sanitized_name_collisions() {
658658
assert res.output.trim_space().replace('\r\n', '\n') == 'nested-ok\nflat-ok'
659659
}
660660

661-
// generated_c_symbol_with_prefix extracts one generated C symbol from compiler output.
662-
fn generated_c_symbol_with_prefix(output string, prefix string) string {
663-
idx := output.index(prefix) or { return '' }
664-
rest := output[idx..]
665-
mut end := 0
666-
for end < rest.len && (rest[end].is_letter() || rest[end].is_digit() || rest[end] == `_`) {
667-
end++
661+
// generated_c_symbols_with_prefix extracts generated C symbols from compiler output.
662+
fn generated_c_symbols_with_prefix(output string, prefix string) []string {
663+
mut symbols := []string{}
664+
mut start := 0
665+
for start < output.len {
666+
idx := output[start..].index(prefix) or { break }
667+
rest := output[start + idx..]
668+
mut end := 0
669+
for end < rest.len && (rest[end].is_letter() || rest[end].is_digit() || rest[end] == `_`) {
670+
end++
671+
}
672+
symbol := rest[..end]
673+
if symbol !in symbols {
674+
symbols << symbol
675+
}
676+
start += idx + end
668677
}
669-
return rest[..end]
678+
symbols.sort()
679+
return symbols
670680
}
671681

672682
fn test_auxiliary_c_symbols_use_stable_type_hashes() {
@@ -711,14 +721,14 @@ fn test_auxiliary_c_symbols_use_stable_type_hashes() {
711721
compilation_b := os.execute(cmd_b)
712722
ensure_compilation_succeeded(compilation_a, cmd_a)
713723
ensure_compilation_succeeded(compilation_b, cmd_b)
714-
compare_a := generated_c_symbol_with_prefix(compilation_a.output, 'compare_')
715-
compare_b := generated_c_symbol_with_prefix(compilation_b.output, 'compare_')
716-
keepalive_a := generated_c_symbol_with_prefix(compilation_a.output,
724+
compare_a := generated_c_symbols_with_prefix(compilation_a.output, 'compare_')
725+
compare_b := generated_c_symbols_with_prefix(compilation_b.output, 'compare_')
726+
keepalive_a := generated_c_symbols_with_prefix(compilation_a.output,
717727
'__v_boehm_collect_keepalive_')
718-
keepalive_b := generated_c_symbol_with_prefix(compilation_b.output,
728+
keepalive_b := generated_c_symbols_with_prefix(compilation_b.output,
719729
'__v_boehm_collect_keepalive_')
720-
assert compare_a != ''
721-
assert keepalive_a != ''
730+
assert compare_a.len > 0
731+
assert keepalive_a.len > 0
722732
assert compare_a == compare_b
723733
assert keepalive_a == keepalive_b
724734
}

0 commit comments

Comments
 (0)