Skip to content

v.builder: enable LTO for clang on OpenBSD - #22247

Merged
medvednikov merged 1 commit into
vlang:masterfrom
lcheylus:openbsd-clang-lto
Sep 18, 2024
Merged

medvednikov merged 1 commit into
vlang:masterfrom
lcheylus:openbsd-clang-lto

Conversation

@lcheylus

@lcheylus lcheylus commented Sep 18, 2024 •

Copy link
Copy Markdown
Contributor

LTO is supported by Clang compiler on OpenBSD => enable -flto during compilation (used with -prod for optimizations)


  • Tests on OpenBSD/amd64 with clang v16 + prod => flag -flto used for compilation OK
$ ./v -prod -cc clang -showcc -o /tmp/hello_world examples/hello_world.v
> C compiler cmd: 'clang' '@/tmp/v_1000/hello_world.01J825QPG073H9G4EXT8EEGF72.tmp.c.rsp'
> C compiler response file "/tmp/v_1000/hello_world.01J825QPG073H9G4EXT8EEGF72.tmp.c.rsp":
  -O3 -flto -DNDEBUG "/home/fox/.vmodules/cache/12/129a7ad1d9dc9094487dea50dd5193de.module.builtin.o" -o "/tmp/hello_world" -D GC_BUILTIN_ATOMIC=1 -D GC_THREADS=1 -I "/home/fox/dev/vlang.git/thirdparty/libgc/include" "/tmp/v_1000/hello_world.01J825QPG073H9G4EXT8EEGF72.tmp.c" -std=c99 -D_DEFAULT_SOURCE -lpthread

$ /tmp/hello_world
Hello, World!

Signed-off-by: Laurent Cheylus <foxy@free.fr>
@medvednikov
medvednikov merged commit ea4bac0 into vlang:master Sep 18, 2024
@lcheylus
lcheylus deleted the openbsd-clang-lto branch September 18, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants