Skip to content

Commit

Permalink
Fix error when compiling on FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
Keve authored and bapt committed Nov 11, 2024
1 parent f57c738 commit 07ca3e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions auto.def
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ cc-with { -libs { -llzma }} {
}
}
if {[string match *-freebsd* [get-define host]]} {
define pkg_freebsd
cc-with { -libs { -lmd }} {
if {![cc-check-functions SHA256_Data]} {
user-error "Unable to find libmd"
Expand Down
5 changes: 4 additions & 1 deletion libpkg/Makefile.autosetup
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,12 @@ LOCAL_LDFLAGS+= -L$(top_builddir)/external/libmachista -lmachista_pic \
SRCS+= pkg_macho.c
@else
SRCS+= pkg_elf.c
@if pkg_freebsd
LOCAL_LDFLAGS+= -Wl,--version-script=$(top_srcdir)/libpkg/libpkg.ver,--undefined-version
@else
# --undefined-version is a FreeBSD ld option
LOCAL_LDFLAGS+= -Wl,--version-script=$(top_srcdir)/libpkg/libpkg.ver
#LOCAL_LDFLAGS+= -Wl,--version-script=$(top_srcdir)/libpkg/libpkg.ver,--undefined-version
@endif
@endif

@if libelf-internal
Expand Down
2 changes: 1 addition & 1 deletion libpkg/pkg_macho.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ pkg_arch_to_legacy(const char *arch, char *dest, size_t sz)
/* Map the architecture name to its CPU type */
ai = NXGetArchInfoFromName(arch + i);
if (ai == NULL) {
// pkg_emit_error("could not find architecture info for %s", arch + i);
pkg_emit_error("could not find architecture info for %s", arch + i);
return EPKG_FATAL;
}

Expand Down

0 comments on commit 07ca3e8

Please sign in to comment.