# How to remove all 32-bit code from the kernel and from all the ports.



## Alain De Vos (Mar 13, 2022)

I compile kernel and ports from source. Is it possible to remove all 32-bit code, and how ? Offcourse i want to compile my compilers clang,gcc without any problem. 
Note : Everything which explicitly depends on 32-bit will fail...


----------



## Alexander88207 (Mar 13, 2022)

Aslong you dont install the lib32 component isnt everything amd64 only anyway?


----------



## Alain De Vos (Mar 13, 2022)

How do i run "make kernel" and "make world" as to remove the lib32 completely ?


----------



## mark_j (Mar 13, 2022)

make with MK_LIB32="NO" ?


----------



## Lamia (Mar 13, 2022)

The beauty of FreeBSD! Mixing 32bits with 64bits in Linux (with few exceptions) for a long time would have spelt doom.


----------



## Alain De Vos (Mar 13, 2022)

Is this MK_LIB32 documented in a man page. I did not found it ?

What i did found was:
cat /usr/src/release/Makefile | grep MK

```
DESTDIR=${.OBJDIR}/${.TARGET} MK_AT=no \
        MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \
        MK_TOOLCHAIN=no MK_PROFILE=no \
        MK_RESCUE=no MK_DICT=no \
        MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no \
        DESTDIR=${.OBJDIR}/${.TARGET} MK_AT=no \
        MK_GAMES=no \
        MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \
        MK_TOOLCHAIN=no MK_PROFILE=no \
        MK_RESCUE=no MK_DICT=no \
        MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no \
        DESTDIR=${.OBJDIR}/${.TARGET} MK_RESCUE=no MK_KERNEL_SYMBOLS=no \
        MK_TESTS=no MK_DEBUG_FILES=no \
```


----------



## driesm (Mar 13, 2022)

Its set by "WITHOUT_LIB32=" in src.conf.


----------



## Alain De Vos (Mar 13, 2022)

In my kernel conf file i'll give a try to :

```
nooption     COMPAT_FREEBSD32    # Compatible with i386 binaries
```
I wonder what will fail ?


----------



## driesm (Apr 11, 2022)

Generally speaking, if every package is compiled from source and supports 64-bit, nothing. Its quite literal as stated there, eg; if a port downloaded a 32-bit binary and installed that as the package, the binary will not run. I tweaked my kernel / world configuration in the past (I just run GENERIC now, benefit is minimal but its fun for tinkering), and this was not an option that caused any pain .


----------

