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

Fix building on OpenBSD #353

Merged
merged 6 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ CXXFLAGS += -Wno-pessimizing-move
CXXFLAGS += -Wno-misleading-indentation
#CXXFLAGS += -Wno-unused-private-field
#CXXFLAGS += -Wno-unknown-warning-option
#CXXFLAGS += -Wno-unqualified-std-cast-call

CXXFLAGS += -Werror=return-type
CXXFLAGS += -Werror=switch
Expand Down Expand Up @@ -186,7 +187,7 @@ $(OBJDIR)%.o: src/%.cpp
$(OBJDIR)version.o: $(OBJDIR)%.o: src/%.cpp $(filter-out $(OBJDIR)version.o,$(OBJ)) Makefile
@+mkdir -p $(dir $@)
@echo [CXX] -o $@
$V$(CXX) -o $@ -c $< $(CXXFLAGS) $(CPPFLAGS) -MMD -MP -MF [email protected] -D VERSION_GIT_FULLHASH=\"$(shell git show --pretty=%H -s --no-show-signature)\" -D VERSION_GIT_BRANCH="\"$(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)\"" -D VERSION_GIT_SHORTHASH=\"$(shell git show -s --pretty=%h --no-show-signature)\" -D VERSION_BUILDTIME="\"$(shell date -uR)\"" -D VERSION_GIT_ISDIRTY=$(shell git diff-index --quiet HEAD; echo $$?)
$V$(CXX) -o $@ -c $< $(CXXFLAGS) $(CPPFLAGS) -MMD -MP -MF [email protected] -D VERSION_GIT_FULLHASH=\"$(shell git show --pretty=%H -s --no-show-signature)\" -D VERSION_GIT_BRANCH="\"$(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)\"" -D VERSION_GIT_SHORTHASH=\"$(shell git show -s --pretty=%h --no-show-signature)\" -D VERSION_BUILDTIME="\"$(shell env LC_TIME=C date -u +"%a, %e %b %Y %T +0000")\"" -D VERSION_GIT_ISDIRTY=$(shell git diff-index --quiet HEAD; echo $$?)

src/main.cpp: $(PCHS:%=src/%.gch)

Expand Down
4 changes: 2 additions & 2 deletions TestRustcBootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ rm -rf ${WORKDIR}build
#
echo "=== Building rustc bootstrap mrustc stage0"
mkdir -p ${WORKDIR}mrustc/
tar -xf rustc-${RUSTC_VERSION_NEXT}-src.tar.gz -C ${WORKDIR}mrustc/
tar -xzf rustc-${RUSTC_VERSION_NEXT}-src.tar.gz -C ${WORKDIR}mrustc/
cat - > ${WORKDIR}mrustc/rustc-${RUSTC_VERSION_NEXT}-src/config.toml <<EOF
[build]
cargo = "${PREFIX}bin/cargo"
Expand Down Expand Up @@ -81,7 +81,7 @@ mv ${WORKDIR}output ${WORKDIR}mrustc-output
#
echo "=== Building rustc bootstrap downloaded stage0"
mkdir -p ${WORKDIR}official/
tar -xf rustc-${RUSTC_VERSION_NEXT}-src.tar.gz -C ${WORKDIR}official/
tar -xzf rustc-${RUSTC_VERSION_NEXT}-src.tar.gz -C ${WORKDIR}official/
cat - > ${WORKDIR}official/rustc-${RUSTC_VERSION_NEXT}-src/config.toml <<EOF
[build]
full-bootstrap = true
Expand Down
2 changes: 1 addition & 1 deletion minicargo.mk
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ $(RUSTC_SRC_TARBALL):
@rm -f $@
@curl -sS https://static.rust-lang.org/dist/$@ -o $@
rustc-$(RUSTC_VERSION)-src/extracted: $(RUSTC_SRC_TARBALL)
tar -xf $(RUSTC_SRC_TARBALL)
tar -xzf $(RUSTC_SRC_TARBALL)
touch $@
$(RUSTC_SRC_DL): rustc-$(RUSTC_VERSION)-src/extracted rustc-$(RUSTC_VERSION)-src.patch
cd $(RUSTCSRC) && patch -p0 < ../rustc-$(RUSTC_VERSION)-src.patch;
Expand Down
7 changes: 7 additions & 0 deletions tools/minicargo/manifest.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
#include <functional>
#include <path.h>

#ifdef __OpenBSD__
realchonk marked this conversation as resolved.
Show resolved Hide resolved
// major() and minor() are defined as macros in <sys/types.h> on OpenBSD
// see: https://man.openbsd.org/major.3
# undef major
# undef minor
#endif

class WorkspaceManifest;
class PackageManifest;
class Repository;
Expand Down
Loading