Initial Commit
- initial default booting image
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
From 9ecfb965e6ea02583874e534f8936ebb43a9db29 Mon Sep 17 00:00:00 2001
|
||||
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
|
||||
Date: Mon, 20 Jul 2026 16:16:22 +0200
|
||||
Subject: [PATCH] Fix EPOLLRDHUP/POLLRDHUP mismatch on Linux SPARC/SPARC64
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Fix a build failure reported by Buildroot autobuild for the
|
||||
bootlin-sparc64-glibc configuration:
|
||||
|
||||
EpollPoller.cc:41:26: error: static assertion failed:
|
||||
EPOLLRDHUP != POLLRDHUP
|
||||
|
||||
On SPARC/SPARC64, EPOLLRDHUP (0x2000) and POLLRDHUP (0x0800) are
|
||||
different bits, breaking the assumption elsewhere in this file that
|
||||
epoll and poll flags are interchangeable.
|
||||
|
||||
Introduce a combined RDHUP value for this architecture and translate
|
||||
it before epoll_ctl() and after epoll_wait(), since revents_ is later
|
||||
tested against POLLRDHUP in Channel::handleEvent() — otherwise
|
||||
half-close detection would silently break at runtime.
|
||||
|
||||
This patch is inspired by the equivalent fix in lighttpd:
|
||||
https://redmine.lighttpd.net/issues/3251
|
||||
|
||||
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
|
||||
Upstream: https://github.com/an-tao/trantor/pull/407
|
||||
---
|
||||
trantor/trantor/net/inner/poller/EpollPoller.cc | 25 ++++++++++++++++++++++++-
|
||||
1 file changed, 24 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/trantor/trantor/net/inner/poller/EpollPoller.cc b/trantor/trantor/net/inner/poller/EpollPoller.cc
|
||||
index c9c4f7d481b4..812b48c30d79 100644
|
||||
--- a/trantor/trantor/net/inner/poller/EpollPoller.cc
|
||||
+++ b/trantor/trantor/net/inner/poller/EpollPoller.cc
|
||||
@@ -22,6 +22,9 @@
|
||||
#include <assert.h>
|
||||
#include <strings.h>
|
||||
#include <iostream>
|
||||
+#if (defined(__sparc__) || defined(__sparc))
|
||||
+#define TRANTOR_RDHUP 0x2800 /* EPOLLRDHUP | POLLRDHUP */
|
||||
+#endif
|
||||
#elif defined _WIN32
|
||||
#include "Wepoll.h"
|
||||
#include <assert.h>
|
||||
@@ -38,7 +41,12 @@ namespace trantor
|
||||
static_assert(EPOLLIN == POLLIN, "EPOLLIN != POLLIN");
|
||||
static_assert(EPOLLPRI == POLLPRI, "EPOLLPRI != POLLPRI");
|
||||
static_assert(EPOLLOUT == POLLOUT, "EPOLLOUT != POLLOUT");
|
||||
+#if (defined(__sparc__) || defined(__sparc))
|
||||
+static_assert(EPOLLRDHUP & TRANTOR_RDHUP,
|
||||
+ "EPOLLRDHUP not included in TRANTOR_RDHUP");
|
||||
+#else
|
||||
static_assert(EPOLLRDHUP == POLLRDHUP, "EPOLLRDHUP != POLLRDHUP");
|
||||
+#endif
|
||||
static_assert(EPOLLERR == POLLERR, "EPOLLERR != POLLERR");
|
||||
static_assert(EPOLLHUP == POLLHUP, "EPOLLHUP != POLLHUP");
|
||||
#endif
|
||||
@@ -127,7 +135,15 @@ void EpollPoller::fillActiveChannels(int numEvents,
|
||||
assert(it != channels_.end());
|
||||
assert(it->second == channel);
|
||||
#endif
|
||||
- channel->setRevents(events_[i].events);
|
||||
+ int revents = events_[i].events;
|
||||
+#if defined(__linux__) && (defined(__sparc__) || defined(__sparc))
|
||||
+ if (revents & EPOLLRDHUP)
|
||||
+ {
|
||||
+ revents &= ~EPOLLRDHUP;
|
||||
+ revents |= POLLRDHUP;
|
||||
+ }
|
||||
+#endif
|
||||
+ channel->setRevents(revents);
|
||||
activeChannels->push_back(channel);
|
||||
}
|
||||
// LOG_TRACE<<"active Channels num:"<<activeChannels->size();
|
||||
@@ -205,6 +221,13 @@ void EpollPoller::update(int operation, Channel *channel)
|
||||
struct epoll_event event;
|
||||
memset(&event, 0, sizeof(event));
|
||||
event.events = channel->events();
|
||||
+#if defined(__linux__) && (defined(__sparc__) || defined(__sparc))
|
||||
+ if (event.events & TRANTOR_RDHUP)
|
||||
+ {
|
||||
+ event.events &= ~TRANTOR_RDHUP;
|
||||
+ event.events |= EPOLLRDHUP;
|
||||
+ }
|
||||
+#endif
|
||||
event.data.ptr = channel;
|
||||
int fd = channel->fd();
|
||||
if (::epoll_ctl(epollfd_, operation, fd, &event) < 0)
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From cd29aa61d299c82d82d3285215fc4fc65e4d4fb9 Mon Sep 17 00:00:00 2001
|
||||
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
|
||||
Date: Sun, 30 Aug 2026 12:00:00 +0200
|
||||
Subject: [PATCH] Fix incomplete 'struct tm' type on uClibc
|
||||
|
||||
Fix a build failure [1] reported by Buildroot autobuild for the
|
||||
mips/uClibc configuration:
|
||||
|
||||
Date.cc:98:28: error: return type 'struct trantor::tm' is incomplete
|
||||
98 | struct tm Date::tmStruct() const
|
||||
| ^~~~~
|
||||
|
||||
Add the missing include to Date.h.
|
||||
|
||||
[1] https://autobuild.buildroot.org/results/e48e0fc1b95a8ad5de964b1e6d12bc45ac39f0b4/
|
||||
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
|
||||
Upstream: https://github.com/an-tao/trantor/pull/415
|
||||
---
|
||||
trantor/utils/Date.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/trantor/trantor/utils/Date.h b/trantor/trantor/utils/Date.h
|
||||
index 4367d76e0305..41b02d355d14 100644
|
||||
--- a/trantor/trantor/utils/Date.h
|
||||
+++ b/trantor/trantor/utils/Date.h
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include <trantor/exports.h>
|
||||
#include <stdint.h>
|
||||
+#include <time.h>
|
||||
#include <string>
|
||||
|
||||
namespace trantor
|
||||
--
|
||||
2.43.0
|
||||
|
||||
52
package/drogon/Config.in
Normal file
52
package/drogon/Config.in
Normal file
@@ -0,0 +1,52 @@
|
||||
config BR2_PACKAGE_DROGON
|
||||
bool "drogon"
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_11 # C++17/20
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
depends on BR2_USE_MMU # fork()
|
||||
select BR2_PACKAGE_JSONCPP
|
||||
select BR2_PACKAGE_UTIL_LINUX
|
||||
select BR2_PACKAGE_UTIL_LINUX_LIBUUID
|
||||
select BR2_PACKAGE_ZLIB
|
||||
help
|
||||
Drogon is a C++17/20 based HTTP application framework.
|
||||
Drogon can be used to easily build various types of web
|
||||
application server programs using C++.
|
||||
|
||||
https://github.com/drogonframework/drogon
|
||||
|
||||
if BR2_PACKAGE_DROGON
|
||||
|
||||
config BR2_PACKAGE_DROGON_BROTLI
|
||||
bool "build Brotli"
|
||||
select BR2_PACKAGE_BROTLI
|
||||
help
|
||||
Add support for brotli compression.
|
||||
|
||||
config BR2_PACKAGE_DROGON_CTL
|
||||
bool "build drogon_ctl"
|
||||
help
|
||||
drogon_ctl is a command-line tool used to generate
|
||||
project skeletons and source code.
|
||||
|
||||
config BR2_PACKAGE_DROGON_EXAMPLES
|
||||
bool "build examples"
|
||||
|
||||
config BR2_PACKAGE_DROGON_ORM
|
||||
bool "build orm"
|
||||
help
|
||||
Enable the ORM module for typed database access.
|
||||
|
||||
config BR2_PACKAGE_DROGON_YAML_CONFIG
|
||||
bool "build yaml config"
|
||||
select BR2_PACKAGE_YAML_CPP
|
||||
help
|
||||
Add support for YAML configuration via yaml-cpp.
|
||||
|
||||
endif
|
||||
|
||||
comment "drogon needs a toolchain w/ C++, threads, gcc >= 11"
|
||||
depends on BR2_USE_MMU
|
||||
depends on !BR2_INSTALL_LIBSTDCPP || \
|
||||
!BR2_TOOLCHAIN_GCC_AT_LEAST_11 || \
|
||||
!BR2_TOOLCHAIN_HAS_THREADS
|
||||
3
package/drogon/drogon.hash
Normal file
3
package/drogon/drogon.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 1d7dc4591b61c34903362209e58a3f92903c76ce6514ffba5ccfaa86a2e3227c drogon-v1.9.13-git4.tar.gz
|
||||
sha256 7e1ed2ca339c384279f1e195e99916eb0145a0d87659969c7e22f8fdd53e11fd LICENSE
|
||||
68
package/drogon/drogon.mk
Normal file
68
package/drogon/drogon.mk
Normal file
@@ -0,0 +1,68 @@
|
||||
################################################################################
|
||||
#
|
||||
# drogon
|
||||
#
|
||||
################################################################################
|
||||
|
||||
DROGON_VERSION = v1.9.13
|
||||
DROGON_SITE = https://github.com/drogonframework/drogon
|
||||
DROGON_SITE_METHOD = git
|
||||
DROGON_GIT_SUBMODULES = YES
|
||||
DROGON_LICENSE = MIT
|
||||
DROGON_LICENSE_FILES = LICENSE
|
||||
DROGON_INSTALL_STAGING = YES
|
||||
|
||||
DROGON_DEPENDENCIES = jsoncpp util-linux zlib
|
||||
HOST_DROGON_DEPENDENCIES = host-jsoncpp host-util-linux host-zlib
|
||||
|
||||
DROGON_CONF_OPTS = \
|
||||
-DBUILD_TESTS=OFF
|
||||
|
||||
HOST_DROGON_CONF_OPTS = \
|
||||
-DBUILD_CTL=ON \
|
||||
-DBUILD_EXAMPLES=OFF \
|
||||
-DBUILD_TESTS=OFF
|
||||
|
||||
ifeq ($(BR2_PACKAGE_DROGON_BROTLI),y)
|
||||
DROGON_DEPENDENCIES += brotli
|
||||
DROGON_CONF_OPTS += -DBUILD_BROTLI=ON
|
||||
else
|
||||
DROGON_CONF_OPTS += -DBUILD_BROTLI=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_DROGON_CTL),y)
|
||||
# When we have drogon_ctl for the target, we need to build the
|
||||
# _drogon_ctl tool with host-drogon support so that it can be
|
||||
# run during the building process
|
||||
DROGON_DEPENDENCIES += host-drogon
|
||||
DROGON_CONF_OPTS += -DBUILD_CTL=ON
|
||||
else
|
||||
DROGON_CONF_OPTS += -DBUILD_CTL=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_DROGON_EXAMPLES),y)
|
||||
# Some examples embed CSP views, whose C++ sources are generated at
|
||||
# build time by drogon_ctl. When cross-compiling, CMake does not
|
||||
# substitute the drogon_ctl target executable in the custom command, so
|
||||
# the tool is looked up in PATH and must be provided by host-drogon.
|
||||
DROGON_DEPENDENCIES += host-drogon
|
||||
DROGON_CONF_OPTS += -DBUILD_EXAMPLES=ON
|
||||
else
|
||||
DROGON_CONF_OPTS += -DBUILD_EXAMPLES=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_DROGON_ORM),y)
|
||||
DROGON_CONF_OPTS += -DBUILD_ORM=ON
|
||||
else
|
||||
DROGON_CONF_OPTS += -DBUILD_ORM=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_DROGON_YAML_CONFIG),y)
|
||||
DROGON_DEPENDENCIES += yaml-cpp
|
||||
DROGON_CONF_OPTS += -DBUILD_YAML_CONFIG=ON
|
||||
else
|
||||
DROGON_CONF_OPTS += -DBUILD_YAML_CONFIG=OFF
|
||||
endif
|
||||
|
||||
$(eval $(cmake-package))
|
||||
$(eval $(host-cmake-package))
|
||||
Reference in New Issue
Block a user