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

Port to Linux platforms that use musl-libc instead of glibc #2275

Merged
merged 10 commits into from
Aug 12, 2024
56 changes: 56 additions & 0 deletions .github/workflows/linux-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: linux-container

on:
push:
pull_request:
schedule:
- cron: '0 1 * * SUN'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
strategy:
fail-fast: false
runs-on: ubuntu-22.04
name: alpine-3.18
env:
ACE_ROOT: ${{ github.workspace }}/ACE
TAO_ROOT: ${{ github.workspace }}/TAO
MPC_ROOT: ${{ github.workspace }}/MPC
steps:
- name: Checkout ACE_TAO
uses: actions/checkout@v4
- name: Checkout MPC
uses: actions/checkout@v4
with:
repository: DOCGroup/MPC
path: ${{ env.MPC_ROOT }}
- name: Write configuation files
run: |
echo '#include "ace/config-linux.h"' > ${{ env.ACE_ROOT }}/ace/config.h
echo 'include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU' > ${{ env.ACE_ROOT }}/include/makeinclude/platform_macros.GNU
- name: Build in container
uses: addnab/docker-run-action@v3
with:
image: alpine:3.18
options: -v ${{ github.workspace }}:${{ github.workspace }}
run: |
apk add --no-cache git bash make g++ perl linux-headers
export ACE_ROOT=${{ env.ACE_ROOT }}
export TAO_ROOT=${{ env.TAO_ROOT }}
export MPC_ROOT=${{ env.MPC_ROOT }}
perl ${{ env.ACE_ROOT }}/bin/mwc.pl -type gnuace ${{ env.TAO_ROOT }}/TAO_ACE.mwc -workers 4
perl ${{ env.ACE_ROOT }}/bin/mwc.pl -type gnuace ${{ env.ACE_ROOT }}/tests/tests.mwc -workers 4
perl ${{ env.ACE_ROOT }}/bin/mwc.pl -type gnuace ${{ env.TAO_ROOT }}/tests/IDL_Test -workers 4
perl ${{ env.ACE_ROOT }}/bin/mwc.pl -type gnuace ${{ env.TAO_ROOT }}/tests/IDLv4 -workers 4
make -j 6 -C ${{ env.TAO_ROOT }}
make -j 6 -C ${{ env.ACE_ROOT }}/tests
make -j 6 -C ${{ env.TAO_ROOT }}/tests/IDL_Test
make -j 6 -C ${{ env.TAO_ROOT }}/tests/IDLv4
10 changes: 5 additions & 5 deletions ACE/ace/Dev_Poll_Reactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1117,10 +1117,10 @@ ACE_Dev_Poll_Reactor::dispatch_io_event (Token_Guard &guard)

// Define bits to check for while dispatching.
#if defined (ACE_HAS_EVENT_POLL)
const __uint32_t out_event = EPOLLOUT;
const __uint32_t exc_event = EPOLLPRI;
const __uint32_t in_event = EPOLLIN;
const __uint32_t err_event = EPOLLHUP | EPOLLERR;
const ACE_UINT32 out_event = EPOLLOUT;
const ACE_UINT32 exc_event = EPOLLPRI;
const ACE_UINT32 in_event = EPOLLIN;
const ACE_UINT32 err_event = EPOLLHUP | EPOLLERR;
#else
const short out_event = POLLOUT;
const short exc_event = POLLPRI;
Expand All @@ -1133,7 +1133,7 @@ ACE_Dev_Poll_Reactor::dispatch_io_event (Token_Guard &guard)
// is invalid, there's no event there. Else process it. In any event, we
// have the event, so clear event_ for the next thread.
const ACE_HANDLE handle = this->event_.data.fd;
__uint32_t revents = this->event_.events;
ACE_UINT32 revents = this->event_.events;
this->event_.data.fd = ACE_INVALID_HANDLE;
this->event_.events = 0;
if (handle != ACE_INVALID_HANDLE)
Expand Down
33 changes: 23 additions & 10 deletions ACE/ace/config-linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

#define ACE_HAS_UALARM

#if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 10)
#if defined (__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 10))
// Although the scandir man page says otherwise, this setting is correct.
// The setting was fixed in 2.10, so do not use the hack after that.
# define ACE_SCANDIR_CMP_USES_CONST_VOIDPTR
Expand All @@ -120,7 +120,9 @@
#define ACE_HAS_SYSV_IPC

// Compiler/platform defines a union semun for SysV shared memory.
#define ACE_HAS_SEMUN
#if defined (__GLIBC__)
# define ACE_HAS_SEMUN
#endif

#if defined (__powerpc__) && !defined (ACE_SIZEOF_LONG_DOUBLE)
// 32bit PowerPC Linux uses 128bit long double
Expand Down Expand Up @@ -186,10 +188,6 @@
# undef ACE_SCANDIR_CMP_USES_VOIDPTR
# endif /* ACE_SCANDIR_CMP_USES_VOIDPTR */

# if defined (ACE_SCANDIR_CMP_USES_CONST_VOIDPTR)
# undef ACE_SCANDIR_CMP_USES_CONST_VOIDPTR
# endif /* ACE_SCANDIR_CMP_USES_CONST_VOIDPTR */

# if defined (ACE_HAS_EXECINFO_H)
# undef ACE_HAS_EXECINFO_H
# endif /* ACE_HAS_EXECINFO_H */
Expand All @@ -198,12 +196,27 @@
# undef __GLIBC__
# endif /* __GLIBC__ */

# if defined(ACE_HAS_SEMUN)
# undef ACE_HAS_SEMUN
# endif /* ACE_HAS_SEMUN */

#endif /* __UCLIBC__ */

#if !defined (__GLIBC__) && !defined (__UCLIBC__)
// Assume musl, it has no equivalent macro

#define ACE_HAS_CPU_SET_T
#define ACE_HAS_PTHREADS
#define ACE_HAS_PTHREADS_UNIX98_EXT
#define ACE_HAS_RECURSIVE_MUTEXES
#define ACE_HAS_SIGINFO_T
#define ACE_HAS_SIGTIMEDWAIT
#define ACE_HAS_SOCKLEN_T
#define ACE_HAS_UCONTEXT_T

#define ACE_LACKS_ISCTYPE
#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
#define ACE_LACKS_SIGINFO_H
#define ACE_LACKS_SYS_SYSCTL_H

#endif

#include /**/ "ace/post.h"

#endif /* ACE_CONFIG_LINUX_H */
4 changes: 4 additions & 0 deletions ACE/ace/os_include/sys/os_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
# include /**/ <sys/types.h>
#endif /* !ACE_LACKS_SYS_TYPES_H */

#if !defined (ACE_LACKS_FCNTL_H)
# include /**/ <fcntl.h>
#endif /* !ACE_LACKS_FCNTL_H */

# if defined (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB) && \
(ACE_USES_STD_NAMESPACE_FOR_STDC_LIB != 0)
using std::time_t;
Expand Down