Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: adapt to gcc 14.2 #85

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion busybox/22-ifconfig-ipv6.patch
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ index 228ccf7..535c741 100644
+ while (ifap != NULL) {
+ if (strcmp(ifap->ifa_name, ptr->name) == 0) {
+ struct sockaddr_in6 *addr;
+ addr = ifap->ifa_addr;
+ addr = (struct sockaddr_in6 *)ifap->ifa_addr;
+
+ if (addr->sin6_family == AF_INET6) {
+ inet_ntop(AF_INET6, &addr->sin6_addr, addr6, 50);
Expand Down
3 changes: 2 additions & 1 deletion dropbear/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ if [ ! -f "$PREFIX_PORT_BUILD/config.h" ]; then
ENABLE_ZLIB="no" && [ "$PORTS_ZLIB" = "y" ] && ENABLE_ZLIB="yes"
export OLDCFLAGS="-v" # HACKISH: fix ./configure script not detecting externally-provided CFLAGS

( cd "${PREFIX_PORT_BUILD}" && "${PREFIX_DROPBEAR_SRC}/configure" CFLAGS="${CFLAGS} ${DROPBEAR_CFLAGS}" \
# FIXME: -Wno-error=incompatible-pointer-types needed as dropbear uses uint* instead of enum* in cli-kex.c:117.
( cd "${PREFIX_PORT_BUILD}" && "${PREFIX_DROPBEAR_SRC}/configure" CFLAGS="${CFLAGS} ${DROPBEAR_CFLAGS} -Wno-error=incompatible-pointer-types" \
Copy link
Member

Choose a reason for hiding this comment

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

Can be quickly fixed by adding a small patch to our port: cli-kex.c:97 (unsigned int type -> enum signkey_type type)

LDFLAGS="${CFLAGS} ${LDFLAGS} ${DROPBEAR_LDFLAGS}" ARFLAGS="-r" \
Copy link

Choose a reason for hiding this comment

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

📝 [shellcheck] reported by reviewdog 🐶
Possible misspelling: LDFLAGS may not be assigned. Did you mean OLDCFLAGS? SC2153

--host="${HOST}" --includedir="${PREFIX_H}" \
--prefix="${PREFIX_PROG}" --program-prefix="${PREFIX_PROG}" --libdir="${PREFIX_A}" --bindir="${PREFIX_PROG}" --enable-zlib="$ENABLE_ZLIB" --enable-static \
Expand Down
3 changes: 2 additions & 1 deletion lighttpd/build.sh

Choose a reason for hiding this comment

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

📝 [shellcheck] reported by reviewdog 🐶
Possible misspelling: PREFIX_PORT may not be assigned. Did you mean PREFIX_PCRE? SC2153

if [ ! -f "$PREFIX_PORT/${LIGHTTPD}.tar.gz" ]; then

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ if [ ! -f "$PREFIX_PORT_BUILD/config.h" ]; then
CONFIGFILE=$(find "${PREFIX_ROOTFS:?PREFIX_ROOTFS not set!}/etc" -name "lighttpd.conf")
grep mod_ "$CONFIGFILE" | cut -d'"' -f2 | xargs -L1 -I{} echo "PLUGIN_INIT({})" > "$PREFIX_LIGHTTPD_SRC"/src/plugin-static.h

LIGHTTPD_CFLAGS="-DLIGHTTPD_STATIC -DPHOENIX"
# FIXME: -Wno-error=implicit-function-declaration as lighthttp for some reason doesn't include arpa/inet.h when ntohs is used.
LIGHTTPD_CFLAGS="-DLIGHTTPD_STATIC -DPHOENIX -Wno-error=implicit-function-declaration"
Copy link
Member

Choose a reason for hiding this comment

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

Fixed here: lighttpd/lighttpd1.4@385c7dd

Not available even in the latest (1.4.77) version, so we will have to patch this anyway

WITH_ZLIB="no" && [ "$PORTS_ZLIB" = "y" ] && WITH_ZLIB="yes"

( cd "$PREFIX_PORT_BUILD" && "$PREFIX_LIGHTTPD_SRC/configure" LIGHTTPD_STATIC=yes CFLAGS="${LIGHTTPD_CFLAGS} ${CFLAGS}" CPPFLAGS="" LDFLAGS="${LDFLAGS}" AR_FLAGS="-r" \
Expand Down
3 changes: 2 additions & 1 deletion mbedtls/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ done
export phoenix=1

# Build mbedtls without tests
(cd "${PREFIX_PORT_BUILD}/${MBEDTLS}" && make install no_test DESTDIR="$PREFIX_MBEDTLS_DESTDIR")
# FIXME: -Wno-error=incompatible-pointer-types is needed as mbedtls doesn't recognise phoenix definition of socklen_t
(cd "${PREFIX_PORT_BUILD}/${MBEDTLS}" && make install no_test DESTDIR="$PREFIX_MBEDTLS_DESTDIR" CFLAGS="-Wno-error=incompatible-pointer-types")
Copy link
Member

Choose a reason for hiding this comment

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

mbedtls (2.28.0) does the following:

#if defined(__socklen_t_defined) || defined(_SOCKLEN_T) ||  \
    defined(_SOCKLEN_T_DECLARED) || defined(__DEFINED_socklen_t) || \
    defined(socklen_t) || (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L)
    socklen_t n = (socklen_t) sizeof( client_addr );
    socklen_t type_len = (socklen_t) sizeof( type );
#else
    int n = (int) sizeof( client_addr );
    int type_len = (int) sizeof( type );
#endif

Apparently, we don't define any such macros, commonly found in glibc, musl, FreeBSD's libc, etc. (We only define SOCKLEN_T_DEFINED in lwip.) We don't even have _POSIX_VERSION defined in unistd.h. I think defining _POSIX_VERSION is the way to go.


# Build and install tests if needed
if [ "${LONG_TEST}" = "y" ]; then
Expand Down
Loading