Skip to content

Fix builds on latest clang - #13

Open
hpckurt wants to merge 2 commits into
bitkeeper-scm:masterfrom
hpckurt:master
Open

Fix builds on latest clang#13
hpckurt wants to merge 2 commits into
bitkeeper-scm:masterfrom
hpckurt:master

Conversation

@hpckurt

@hpckurt hpckurt commented Jul 2, 2026

Copy link
Copy Markdown

This PR fixes builds on the latest clang versions. Tested and verified on MacOS 26. zlib needs to be updated since the previously included 1.1.4 no longer builds.

@hpckurt

hpckurt commented Jul 3, 2026

Copy link
Copy Markdown
Author

Mentioning @wscott for visibility

@wscott

wscott commented Jul 3, 2026

Copy link
Copy Markdown
Member

Yeah, I saw it the first time, but haven't gotten around to trying this out.
My first impression was that I wasn't sure we should include a full copy of the zlibc release instead of just the sources.
Or if it should just download the sources if a local copy isn't found.

@wscott
wscott requested review from Copilot and removed request for Copilot July 3, 2026 18:43
@hpckurt

hpckurt commented Jul 3, 2026

Copy link
Copy Markdown
Author

Ah, sorry for the ping then. I included the full zlib sources since that's what was previously included in the src/libc directory. It doesn't really matter how it's handled as long as the updated zlib source is seen at build time.

@wscott wscott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should be able to do a build on MacOS in a fresh clone by only typing make in the src subdir.

These are the fixes I noticed. I was going to just push changes but I don't think I can.

Comment thread src/Makefile
ifeq ($(shell uname -s), Darwin)
XLIBS += -lresolv
G += -DNOPROC
WARNINGS +=

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This line is pointless and in fact the whole block can be removed because it already happens in mkconf.sh

Comment thread src/libc/zlib/Makefile

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This was not the original Makefile, but a wrapper used by the larger build. You shouldn't be building this yourself.

For me this worked:

zlib.fake:
	$(MAKE) -C.. zlib

ZLIB_OBJS = $(patsubst %,zlib/%, \
	adler32.o \
	compress.o crc32.o \
	deflate.o \
	infback.o inffast.o inflate.o inftrees.o \
	trees.o \
	uncompr.o \
	zutil.o)

ZLIB_HDRS = $(patsubst %,zlib/%, \
	crc32.h deflate.h gzguts.h inffast.h inffixed.h inflate.h \
	inftrees.h trees.h zconf.h zlib.h zutil.h \
	)


zlib: $(ZLIB_OBJS)

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