diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7a5dda3fa..c1af38b707 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -292,7 +292,7 @@ jobs: - name: v.c can be compiled and run run: | ./v -os cross -o /tmp/v.c cmd/v - gcc -g -std=gnu11 -w -o v_from_vc /tmp/v.c -lm + gcc -g -std=gnu11 -w -o v_from_vc /tmp/v.c -lm -lpthread ls -lart v_from_vc ./v_from_vc version - name: v_win.c can be compiled and run diff --git a/Makefile b/Makefile index e1f3735e08..6ed3b0758f 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ ifdef WIN32 $(CC) $(CFLAGS) -g -std=c99 -municode -w -o v.exe $(TMPVC)/$(VCFILE) $(LDFLAGS) ./v.exe self else - $(CC) $(CFLAGS) -g -std=gnu11 -w -o v $(TMPVC)/$(VCFILE) $(LDFLAGS) -lm + $(CC) $(CFLAGS) -g -std=gnu11 -w -o v $(TMPVC)/$(VCFILE) $(LDFLAGS) -lm -lpthread ifdef ANDROID chmod 755 v endif diff --git a/vlib/sync/sync_nix.c.v b/vlib/sync/sync_nix.c.v index 37be8ae997..341a0b4245 100644 --- a/vlib/sync/sync_nix.c.v +++ b/vlib/sync/sync_nix.c.v @@ -3,6 +3,8 @@ // that can be found in the LICENSE file. module sync +#flag -lpthread + // [init_with=new_mutex] // TODO: implement support for this struct attribute, and disallow Mutex{} from outside the sync.new_mutex() function. [ref_only] pub struct Mutex { diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index f143c0a838..e2a93bc5ff 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -192,6 +192,11 @@ pub fn parse_files(paths []string, table &table.Table, pref &pref.Preferences, g return q.parsed_ast_files } } + if false { + // TODO: remove this; it just prevents warnings about unused time and runtime + time.sleep_ms(1) + println(runtime.nr_cpus()) + } // /////////////// mut files := []ast.File{} for path in paths {