Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Question: which gcc/g++ version does it support? #1

Closed
krshrimali opened this issue Aug 26, 2022 · 5 comments
Closed

Question: which gcc/g++ version does it support? #1

krshrimali opened this issue Aug 26, 2022 · 5 comments

Comments

@krshrimali
Copy link

Hi @foonathan ! Thank you for your streams, and work here.

I was trying to follow along with your stream, trying to write it myself, and couldn't compile. I cross-checked by directly cloning this repo, and trying to build it, and I get this error:

[ 17%] Building CXX object _deps/lauf-build/src/CMakeFiles/lauf_core.dir/lauf/vm.cpp.o
In file included from /tmp/clauf/_deps/lauf-src/src/../include/lauf/vm.h:7,
                 from /tmp/clauf/_deps/lauf-src/src/./lauf/vm.hpp:7,
                 from /tmp/clauf/_deps/lauf-src/src/lauf/vm.cpp:4:
/tmp/clauf/_deps/lauf-src/src/./lauf/vm_execute.hpp: In function ‘bool lauf::execute(const lauf_asm_inst*, lauf_runtime_value*, lauf_runtime_stack_frame*, lauf_runtime_process*)’:
/tmp/clauf/_deps/lauf-src/src/../include/lauf/config.h:42:24: error: attributes at the beginning of statement are ignored [-Werror=attributes]
   42 | #define LAUF_TAIL_CALL [[clang::musttail]]
      |                        ^~~~~~~~~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/./lauf/vm_execute.hpp:16:5: note: in expansion of macro ‘LAUF_TAIL_CALL’
   16 |     LAUF_TAIL_CALL return lauf::dispatch[std::size_t(ip->op())](ip, vstack_ptr, frame_ptr, process)
      |     ^~~~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/./lauf/vm_execute.hpp:21:5: note: in expansion of macro ‘LAUF_VM_DISPATCH’
   21 |     LAUF_VM_DISPATCH;
      |     ^~~~~~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/./lauf/vm_execute.hpp: In function ‘bool lauf_runtime_builtin_dispatch(const lauf_asm_inst*, lauf_runtime_value*, lauf_runtime_stack_frame*, lauf_runtime_process*)’:
/tmp/clauf/_deps/lauf-src/src/../include/lauf/config.h:42:24: error: attributes at the beginning of statement are ignored [-Werror=attributes]
   42 | #define LAUF_TAIL_CALL [[clang::musttail]]
      |                        ^~~~~~~~~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/./lauf/vm_execute.hpp:16:5: note: in expansion of macro ‘LAUF_TAIL_CALL’
   16 |     LAUF_TAIL_CALL return lauf::dispatch[std::size_t(ip->op())](ip, vstack_ptr, frame_ptr, process)
      |     ^~~~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/./lauf/vm_execute.hpp:30:5: note: in expansion of macro ‘LAUF_VM_DISPATCH’
   30 |     LAUF_VM_DISPATCH;
      |     ^~~~~~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/lauf/vm.cpp: In function ‘bool lauf_vm_execute(lauf_vm*, lauf_asm_program*, const lauf_runtime_value*, lauf_runtime_value*)’:
/tmp/clauf/_deps/lauf-src/src/lauf/vm.cpp:185:17: error: suggest braces around empty body in an ‘else’ statement [-Werror=empty-body]
  185 |                 ; // We don't know the starting address of the allocation.
      |                 ^
In file included from /tmp/clauf/_deps/lauf-src/src/./lauf/runtime/process.hpp:12,
                 from /tmp/clauf/_deps/lauf-src/src/./lauf/vm.hpp:10:
/tmp/clauf/_deps/lauf-src/src/./lauf/support/array.hpp: In instantiation of ‘void lauf::array<T>::reserve(lauf::arena_base&, std::size_t) [with T = lauf::allocation; std::size_t = long unsigned int]’:
/tmp/clauf/_deps/lauf-src/src/./lauf/support/array.hpp:179:13:   required from ‘void lauf::array<T>::resize_uninitialized(lauf::arena_base&, std::size_t) [with T = lauf::allocation; std::size_t = long unsigned int]’
/tmp/clauf/_deps/lauf-src/src/lauf/vm.cpp:102:46:   required from here
/tmp/clauf/_deps/lauf-src/src/./lauf/support/array.hpp:126:25: error: conversion from ‘long unsigned int’ to ‘long unsigned int:63’ may change value [-Werror=conversion]
  126 |             _capacity = new_capacity;
      |                         ^~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/./lauf/support/array.hpp:136:25: error: conversion from ‘long unsigned int’ to ‘long unsigned int:63’ may change value [-Werror=conversion]
  136 |             _capacity = new_capacity;
      |                         ^~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [_deps/lauf-build/src/CMakeFiles/lauf_core.dir/build.make:104: _deps/lauf-build/src/CMakeFiles/lauf_core.dir/lauf/vm.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:299: _deps/lauf-build/src/CMakeFiles/lauf_core.dir/all] Error 2
make: *** [Makefile:101: all] Error 

I understand the project is in very initial stages, but I just wanted to understand if I'm using any wrong version of compiler since you mentioned C++ 23 in your README.

I'm using: g++ (GCC) 12.2.0.

@foonathan
Copy link
Owner

Compiler support is currently limited by lauf, which requires clang 13 or newer. GCC is missing the musttail attribute, so isn't supported until I implement a different dispatching technique.

@krshrimali
Copy link
Author

Compiler support is currently limited by lauf, which requires clang 13 or newer. GCC is missing the musttail attribute, so isn't supported until I implement a different dispatching technique.

Thanks! I tried using clang (14.0.6 version), but still the same error.

@foonathan
Copy link
Owner

Are you sure you've set up CMake properly? I'm using clang 14.0.6 as well...

@krshrimali
Copy link
Author

Are you sure you've set up CMake properly? I'm using clang 14.0.6 as well...

I just checked the GitHub CI https://github.com/foonathan/clauf/blob/main/.github/workflows/ci.yml and the commands, work once I do: export CC=/usr/bin/clang and export CXX=/usr/bin/clang++. Sorry for the noise!

@foonathan
Copy link
Owner

No problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants