Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD] Move from GCC to Clang #1816

Draft
wants to merge 15 commits into
base: john-upgrade-mbedtls
Choose a base branch
from
Draft

Conversation

johnmlee101
Copy link
Contributor

Details

Fixed Issues

Fixes GH_LINK

Tests


Internal Testing Reminder: when changing bedrock, please compile auth against your new changes

@johnmlee101 johnmlee101 self-assigned this Jul 16, 2024
@johnmlee101 johnmlee101 changed the base branch from john-upgrade-mbedtls to main July 16, 2024 15:52
@johnmlee101
Copy link
Contributor Author

Okay steps so far to get to where I'm at.

on the vm in a random spot

wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18 all

add /usr/lib/llvm-18/lib to the ldconfig

and right now its seems to fail on the linking and I'm stuck on compilation, the linker seems to not be working well with libc++ or importing it properly and it is returning

SSocketPool.cpp:(.text+0x2c): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'

and such which is failing compilation

@johnmlee101 johnmlee101 changed the base branch from main to john-upgrade-mbedtls July 17, 2024 17:50
Makefile Outdated
@@ -23,16 +23,16 @@ PROJECT = $(shell git rev-parse --show-toplevel)
INCLUDE = -I$(PROJECT) -I$(PROJECT)/mbedtls/include

# Set our standard C++ compiler flags
CXXFLAGS = -g -std=c++20 -fPIC -DSQLITE_ENABLE_NORMALIZE $(BEDROCK_OPTIM_COMPILE_FLAG) -Wall -Werror -Wformat-security -Wno-error=deprecated-declarations $(INCLUDE)
CXXFLAGS = -g -std=c++20 -gdwarf-4 -stdlib=libc++ -I/usr/include/c++/v1 -fPIC -DSQLITE_ENABLE_NORMALIZE $(BEDROCK_OPTIM_COMPILE_FLAG) -Wno-vla-cxx-extension -Wno-unqualified-std-cast-call -Werror -Wformat-security -Wno-error=deprecated-declarations $(INCLUDE) #-Wall -Werror
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-gdwarf-4 is here because otherwise clang outputs newer dwarf formats (version 5) than gnu ld will understand. We should be able get rid of this if we use clang's lld linker. For now, this outputs the older format.

@johnmlee101
Copy link
Contributor Author

This pcre problem is a real head-scratcher- pcre hasn't been maintained in awhile so pcre2 is the way to go, but we might need a wrapper to properly drop-in install it.

@tylerkaraszewski
Copy link
Contributor

It's used in only a few places. We could update code to use PCRE2 pretty easily, it's probably only a few lines.

@johnmlee101
Copy link
Contributor Author

was trying to get gh actions working but llvm.sh is failing so will check on this later

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.

None yet

2 participants