Skip to content

Conversation

@opntr
Copy link

@opntr opntr commented Dec 15, 2025

Compiling FreeBSD main (16-CURRENT) on Intel MBP with latest macOS trigger build errors.

@opntr opntr requested review from bapt and bsdimp as code owners December 15, 2025 12:31
@emaste
Copy link
Member

emaste commented Dec 15, 2025

Generally looks good. For thr_printf.c we could perhaps introduce nonstring or use { '0', '1', .... I see there have been a few recent commits for nonstring but I don't think we have a project policy yet.

@opntr
Copy link
Author

opntr commented Dec 15, 2025

Yes, I agree. I've already introduced the __nonstring define in cdefs.h. The only question is about the style of the usage:

a)

__nonstring type var = "foo";

or

b)

type var __nonstring = "foo";

is preferred?

@opntr opntr changed the title Allow to build main on Intel macOS 26 [draft] Allow to build main on Intel macOS 26 Dec 15, 2025
@github-actions
Copy link

github-actions bot commented Dec 15, 2025

Thank you for taking the time to contribute to FreeBSD!
All issues resolved.

@opntr
Copy link
Author

opntr commented Dec 16, 2025

and I've just found now @arichardson 's PR: #1847 which mostly contains my fixes

Copy link
Contributor

@arichardson arichardson left a comment

Choose a reason for hiding this comment

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

Thanka for this contribution. For the nonstring I already have some approved phabricator revisions that I just need to land. I plan to do so tomorrow.

@arichardson
Copy link
Contributor

Apologies for being slow in landing these, other priorities have taken up all my time lately

@opntr
Copy link
Author

opntr commented Dec 16, 2025

@arichardson do you need any help?

@opntr
Copy link
Author

opntr commented Dec 16, 2025

I will rework this branch to only contain the fixes for Intel mac, I will test your changes ontop of the intel fix

Without this the libcrypto build fails with undefined symbols build
error. The corresponding EC functions doesn't get's picked up at
secure/lib/libcrypto/Makefile:237 due the missing MACHINE_ABI define.

Signed-off-by: Oliver Pinter <oliver.pntr+freebsd@gmail.com>
@opntr opntr changed the title [draft] Allow to build main on Intel macOS 26 Allow to build main on Intel macOS 26 Dec 16, 2025
@opntr opntr requested a review from arichardson December 16, 2025 12:44
found during crossbuild on macOS

Signed-off-by: Oliver Pinter <oliver.pntr+freebsd@gmail.com>
@opntr
Copy link
Author

opntr commented Dec 16, 2025

@emaste could you please take a look again?

/src.conf

# for crossbuilds on macOS
tools/build/test-includes
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm this one is weird, we shouldn't be generating any files here, everything should be in the build dir.

@arichardson
Copy link
Contributor

arichardson commented Dec 16, 2025

@arichardson do you need any help?

I committed my initial set of changes and will rebase the remaining ones soon. This is enough to pass the host tools phase, but the buildworld phase still needs the additional fixes for latest clang.

@arichardson
Copy link
Contributor

Okay I've updated #1847, hopefully I can land the rest of the changes soon.

faster repro:
```
op@opmbp src % ../build-gen.sh V=0 -C usr.bin/vi/catalog/
/usr/local/bin/bmake
bmake: don't know how to make dutch.base. Stop

bmake: stopped making "all" in /Users/op/data/git/git.FreeBSD.org/freebsd/src/usr.bin/vi/catalog
```

Signed-off-by: Oliver Pinter <oliver.pntr+freebsd@gmail.com>
@opntr
Copy link
Author

opntr commented Dec 17, 2025

Seems like vi/catalog is also weird:

... swedish.UTF-8
echo "... zh_CN.UTF-8";                                                  rm -f zh_CN.UTF-8;                                                      env LC_ALL=C sort -u zh_CN.UTF-8.base |                                 awk '{         
                                                 if ($1 == 1) {                                          print "\nMESSAGE NUMBER 1 IS NOT LEGAL";  exit 1;                                                 }                      
                                 if (++nline > $1) {                                     print "DUPLICATE MESSAGE NUMBER " $1;           exit 1;                                                 }                              
                         print $0;        }' |                                                             sed -e '1s/^/$set 1~$quote "~/; 1y/~/\n/' |                     gencat zh_CN.UTF-8 /dev/stdin;                                 
         chmod 444 zh_CN.UTF-8;                                                  if grep DUPLICATE zh_CN.UTF-8 > /dev/null; then                                 grep DUPLICATE zh_CN.UTF-8;                                       fi;            
                                                 if grep 'NOT LEGAL' zh_CN.UTF-8 > /dev/null; then                       grep 'NOT LEGAL' zh_CN.UTF-8;                                   fi
... zh_CN.UTF-8
echo "... ru_RU.UTF-8";                                                  rm -f ru_RU.UTF-8;                                                      env LC_ALL=C sort -u ru_RU.UTF-8.base |                                 awk '{         
                                                 if ($1 == 1) {                                          print "\nMESSAGE NUMBER 1 IS NOT LEGAL";  exit 1;                                                 }                      
                                 if (++nline > $1) {                                     print "DUPLICATE MESSAGE NUMBER " $1;           exit 1;                                                 }                              
                         print $0;        }' |                                                             sed -e '1s/^/$set 1~$quote "~/; 1y/~/\n/' |                     gencat ru_RU.UTF-8 /dev/stdin;                                 
         chmod 444 ru_RU.UTF-8;                                                  if grep DUPLICATE ru_RU.UTF-8 > /dev/null; then                                 grep DUPLICATE ru_RU.UTF-8;                                       fi;            
                                                 if grep 'NOT LEGAL' ru_RU.UTF-8 > /dev/null; then                       grep 'NOT LEGAL' ru_RU.UTF-8;                                   fi
... ru_RU.UTF-8
echo "... uk_UA.UTF-8";                                                  rm -f uk_UA.UTF-8;                                                      env LC_ALL=C sort -u uk_UA.UTF-8.base |                                 awk '{         
                                                 if ($1 == 1) {                                          print "\nMESSAGE NUMBER 1 IS NOT LEGAL";  exit 1;                                                 }                      
                                 if (++nline > $1) {                                     print "DUPLICATE MESSAGE NUMBER " $1;           exit 1;                                                 }                              
                         print $0;        }' |                                                             sed -e '1s/^/$set 1~$quote "~/; 1y/~/\n/' |                     gencat uk_UA.UTF-8 /dev/stdin;                                 
         chmod 444 uk_UA.UTF-8;                                                  if grep DUPLICATE uk_UA.UTF-8 > /dev/null; then                                 grep DUPLICATE uk_UA.UTF-8;                                       fi;            
                                                 if grep 'NOT LEGAL' uk_UA.UTF-8 > /dev/null; then                       grep 'NOT LEGAL' uk_UA.UTF-8;                                   fi
... uk_UA.UTF-8
op@opmbp src % git status
On branch op/main
Your branch is ahead of 'origin/op/main' by 1 commit.
  (use "git push" to publish your local commits)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        usr.bin/vi/catalog/dump
        usr.bin/vi/catalog/dutch
        usr.bin/vi/catalog/dutch.UTF-8
        usr.bin/vi/catalog/english
        usr.bin/vi/catalog/english.base
        usr.bin/vi/catalog/french
        usr.bin/vi/catalog/french.UTF-8
        usr.bin/vi/catalog/german
        usr.bin/vi/catalog/german.UTF-8
        usr.bin/vi/catalog/polish
        usr.bin/vi/catalog/polish.UTF-8
        usr.bin/vi/catalog/ru_RU.KOI8-R
        usr.bin/vi/catalog/ru_RU.UTF-8
        usr.bin/vi/catalog/spanish
        usr.bin/vi/catalog/spanish.UTF-8
        usr.bin/vi/catalog/swedish
        usr.bin/vi/catalog/swedish.UTF-8
        usr.bin/vi/catalog/tr_TR.ISO8859-9
        usr.bin/vi/catalog/tr_TR.UTF-8
        usr.bin/vi/catalog/uk_UA.KOI8-U
        usr.bin/vi/catalog/uk_UA.UTF-8
        usr.bin/vi/catalog/zh_CN.GB2312
        usr.bin/vi/catalog/zh_CN.UTF-8

nothing added to commit but untracked files present (use "git add" to track)

@opntr
Copy link
Author

opntr commented Dec 17, 2025

With the in macOS (clang-17) and these patches the world built finally. But it seems like the tests polluting the src:

image

# Currently all 64-bit FreeBSD architectures include 64 in their name
# (see arch(7)). We need a special case for cross-building from macOS
# (which uses arm64/arm).
# (which uses arm64/arm and x86_64/amd64).
Copy link
Contributor

Choose a reason for hiding this comment

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

But both x86_64 and amd64 match 64. This was only here for Apple Silicon because MACHINE_ARCH is arm, no 64 in it.


PACKAGE=vi
V= ${.CURDIR}/../../../contrib/nvi
VI= ${.CURDIR}/../../../contrib/nvi
Copy link
Contributor

Choose a reason for hiding this comment

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

This is entirely unrelated to building on Intel macOS?

Copy link
Contributor

Choose a reason for hiding this comment

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

(and V=0 is not how you silence building FreeBSD, that's you assuming a Linux-ism applies to building FreeBSD and blindly setting a random variable for the build; if you want the FreeBSD build to be quieter, use -s, or -ss for even quieter)

Copy link
Contributor

@jrtc27 jrtc27 left a comment

Choose a reason for hiding this comment

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

All hunks are contested

@jrtc27
Copy link
Contributor

jrtc27 commented Dec 22, 2025

How are you building in order to get that result?

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.

4 participants