Solved fasm throws libc.so.7 error while assembling

I am trying to compile some sample asm code using fasm but I get this error:


$ fasm boot.asm
ld-elf32.so.1: Shared object "libc.so.7" not found, required by "fasm"


I am not sure if this is related to the particular source code but here is it in case it is relevant:

Code:
$ cat boot.asm 
org 0x7C00      ; Bootloader loaded at 0x7C00

start:
    ; Set up segment registers
    mov ax, cs
    mov ds, ax
    mov es, ax

    ; Set up stack
    mov ax, 0x0000
    mov ss, ax
    mov sp, 0x7C00

    ; Print message using BIOS interrupt
    mov si, msg
print_loop:
    lodsb               ; Load next character
    test al, al
    jz halt             ; Jump if null terminator
    mov ah, 0x0E        ; BIOS teletype function
    int 0x10            ; Call BIOS
    jmp print_loop

halt:
    cli                 ; Disable interrupts
    hlt                 ; Halt processor

msg db "Hello, World!", 0

times 510 - ($-$$) db 0 ; Pad to 510 bytes
dw 0xAA55               ; Boot signature

I am running this in a jailed FreebSD14.1:


$ uname -a
FreeBSD qemu 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
 
32-bit libraries are required in /usr/lib32.

While this might be simple or an entry-level question, could you please elaborate?

- Does that mean that I need to install another port that installs 32 bit libraries?
- Is fasm compiling in 32 bits?
- Is fasm compiled in 32 bits? I installed it via pkg install fasm.
 
Code:
fetch https://download.freebsd.org/ftp/releases/amd64/14.1-RELEASE/lib32.txz
tar xzf lib32.txz ./usr/lib32/libc.so.7
mv -i ./usr/lib32/libc.so.7 /usr/lib32

ports/lang/fasm/Makefile
Code:
ONLY_FOR_ARCHS= amd64 i386
IA32_BINARY_PORT=       yes

.if ${ARCH} != "i386"
CFLAGS+=        -m32 -L/usr/lib32 -B/usr/lib32
.endif

file /usr/local/bin/fasm
Code:
/usr/local/bin/fasm: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 14.1, FreeBSD-style, stripped
 
Back
Top