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

boards/native: Remove macOS as native target #18735

Merged
merged 1 commit into from
Oct 26, 2022
Merged
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
5 changes: 3 additions & 2 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,11 @@ include $(RIOTMAKE)/boards.inc.mk
include $(RIOTMAKE)/dependencies_debug.inc.mk

# Use TOOLCHAIN environment variable to select the toolchain to use.
# If native, TOOLCHAIN for OSX is llvm
ifeq ($(BOARD),native)
ifeq ($(OS),Darwin)
TOOLCHAIN ?= llvm
$(shell $(COLOR_ECHO) "$(COLOR_RED)"Buildin on macOS is not supported."\
"We recommend vagrant for building:$(COLOR_RESET)"\
"https://github.com/RIOT-OS/RIOT/blob/master/dist/tools/vagrant/README.md 1>&2)
endif
endif
# Use override so that we can redefine a variable set on the command line (as
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ but not limited to:
* high resolution, long-term timers
* support 100+ boards based on AVR, MSP430, ESP8266, ESP32, RISC-V,
ARM7 and ARM Cortex-M
* the native port allows to run RIOT as-is on Linux, BSD, and MacOS. Multiple
* the native port allows to run RIOT as-is on Linux and BSD. Multiple
instances of RIOT running on a single machine can also be interconnected via
a simple virtual Ethernet bridge
* IPv6
Expand Down
4 changes: 0 additions & 4 deletions cpu/native/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ config CPU_FAM_NATIVE
config CPU_MODEL_NATIVE
bool
select CPU_FAM_NATIVE
select NATIVE_OS_DARWIN if "$(OS)" = "Darwin"
select NATIVE_OS_LINUX if "$(OS)" = "Linux"
select NATIVE_OS_FREEBSD if "$(OS)" = "FreeBSD"

Expand All @@ -54,9 +53,6 @@ config HAS_CPU_NATIVE
Indicates that the cpu being used is 'native'.

## OS Variants
config NATIVE_OS_DARWIN
bool

config NATIVE_OS_LINUX
bool
select HAS_PERIPH_CAN
Expand Down
4 changes: 0 additions & 4 deletions cpu/native/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ ifneq (,$(filter native_vfs,$(USEMODULE)))
DIRS += vfs
endif

ifeq ($(OS),Darwin)
CFLAGS += -D_XOPEN_SOURCE=600 -D_DARWIN_C_SOURCE
endif

ifneq (,$(filter netdev_tap,$(USEMODULE)))
DIRS += netdev_tap
endif
Expand Down
5 changes: 0 additions & 5 deletions cpu/native/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
NATIVEINCLUDES += -I$(RIOTCPU)/native/include -I$(RIOTBASE)/sys/include

# Local include for OSX
ifeq ($(BUILDOSXNATIVE),1)
NATIVEINCLUDES += -I$(RIOTCPU)/native/osx-libc-extra
endif

ifneq (,$(filter periph_can,$(USEMODULE)))
ifeq (,$(filter libsocketcan,$(USEPKG)))
# link system libsocketcan if not using the provided package
Expand Down
6 changes: 0 additions & 6 deletions cpu/native/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,10 @@ To create a bridge and two (or count at your option) tap interfaces:

sudo ../../dist/tools/tapsetup/tapsetup [-c [<count>]]

On macOS you need to start the RIOT instance at some point during the script's
execution. The script will instruct you when to do that.

To delete the bridge and all tap interfaces:

sudo ../../dist/tools/tapsetup/tapsetup -d

For macOS you **have** to run this after killing your RIOT instance and rerun
`sudo ../../dist/tools/tapsetup [-c [<count>]]` before restarting.

**Please note:** If you want to communicate between RIOT and your host
operating system, you must not use the `tapsetup` script, but create and
activate the tap interface manually. On Linux you can do so, by calling
Expand Down
6 changes: 0 additions & 6 deletions cpu/native/async_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ void native_async_read_add_handler(int fd, void *arg, native_async_read_callback

_add_handler(fd, arg, handler);

/* tuntap signalled IO is not working in macOS,
* * check http://sourceforge.net/p/tuntaposx/bugs/18/ */
#ifdef __MACH__
_sigio_child(_next_index);
#else
/* configure fds to send signals on io */
if (real_fcntl(fd, F_SETOWN, _native_pid) == -1) {
err(EXIT_FAILURE, "native_async_read_add_handler(): fcntl(F_SETOWN)");
Expand All @@ -98,7 +93,6 @@ void native_async_read_add_handler(int fd, void *arg, native_async_read_callback
if (real_fcntl(fd, F_SETFL, O_NONBLOCK | O_ASYNC) == -1) {
err(EXIT_FAILURE, "native_async_read_add_handler(): fcntl(F_SETFL)");
}
#endif /* not macOS */

_next_index++;
}
Expand Down
29 changes: 0 additions & 29 deletions cpu/native/include/clang_compat.h

This file was deleted.

23 changes: 0 additions & 23 deletions cpu/native/include/cpu_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,6 @@ extern "C" {
*
* @{
*/
#ifdef __MACH__ /* macOS */
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (163840)
#endif
#ifndef THREAD_STACKSIZE_IDLE
#define THREAD_STACKSIZE_IDLE (THREAD_STACKSIZE_DEFAULT)
#endif
#ifndef THREAD_EXTRA_STACKSIZE_PRINTF
#define THREAD_EXTRA_STACKSIZE_PRINTF (81920)
#endif
#ifndef THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT
#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT (81920)
#endif
/* for core/include/thread.h */
#ifndef THREAD_STACKSIZE_MINIMUM
#define THREAD_STACKSIZE_MINIMUM (THREAD_STACKSIZE_DEFAULT)
#endif
#ifndef ISR_STACKSIZE
#define ISR_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#endif

#else /* Linux etc. */
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (8192)
#endif
Expand All @@ -69,7 +47,6 @@ extern "C" {
#ifndef ISR_STACKSIZE
#define ISR_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#endif
#endif /* OS */
/** @} */

/**
Expand Down
7 changes: 2 additions & 5 deletions cpu/native/netdev_tap/netdev_tap.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,7 @@ static int _init(netdev_t *netdev)
}

char *name = dev->tap_name;
#ifdef __MACH__ /* macOS */
char clonedev[255] = "/dev/"; /* XXX bad size */
strncpy(clonedev + 5, name, 250);
#elif defined(__FreeBSD__)
#ifdef __FreeBSD__
char clonedev[255] = "/dev/"; /* XXX bad size */
strncpy(clonedev + 5, name, 250);
#else /* Linux */
Expand All @@ -356,7 +353,7 @@ static int _init(netdev_t *netdev)
if ((dev->tap_fd = real_open(clonedev, O_RDWR | O_NONBLOCK)) == -1) {
err(EXIT_FAILURE, "open(%s)", clonedev);
}
#if (defined(__MACH__) || defined(__FreeBSD__)) /* macOS/FreeBSD */
#if __FreeBSD__ /* FreeBSD */
struct ifaddrs *iflist;
if (real_getifaddrs(&iflist) == 0) {
for (struct ifaddrs *cur = iflist; cur; cur = cur->ifa_next) {
Expand Down
70 changes: 0 additions & 70 deletions cpu/native/osx-libc-extra/malloc.h

This file was deleted.

9 changes: 0 additions & 9 deletions cpu/native/periph/qdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@
* @}
*/

#ifdef __MACH__
#include <mach/clock.h>
#include <mach/mach_init.h>
#include <mach/mach_port.h>
#include <mach/mach_host.h>
/* Both macOS and RIOT typedef thread_t. timer.c does not use either thread_t. */
#define thread_t riot_thread_t
#endif

#include <time.h>
#include <sys/time.h>
#include <signal.h>
Expand Down
9 changes: 0 additions & 9 deletions cpu/native/periph/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@
* @}
*/

#ifdef __MACH__
#include <mach/clock.h>
#include <mach/mach_init.h>
#include <mach/mach_port.h>
#include <mach/mach_host.h>
/* Both macOS and RIOT typedef thread_t. timer.c does not use either thread_t. */
#define thread_t riot_thread_t
#endif

#include <time.h>
#include <sys/time.h>
#include <signal.h>
Expand Down
16 changes: 8 additions & 8 deletions doc/doxygen/src/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ A set of common tools and a toolchain for the hardware you target needs to be in
### Choosing an Operating System for the Development PC

Most of the RIOT OS developers are using Linux on their development PCs, so you can expect the
most streamlined experience here. Other POSIX-compliant OSes such as current versions of macOS or
the various BSD flavours will also be fine - however, we rely on users to report bugs regarding
tooling incompatibilities here. So expect occasional issues for the development branch and please
help testing during the feature freeze period, if you develop on macOS or BSD.

Native development on Windows machines is not officially supported. What works well is using Linux
in a virtual machine, but at much lower performance than running Linux natively. For development
using the
most streamlined experience here. Other POSIX-compliant OSes such as the various BSD flavours
will also be fine - however, we rely on users to report bugs regarding tooling incompatibilities
here. So expect occasional issues for the development branch and please help testing during the
feature freeze period, if you develop on macOS or BSD.

Native development on Windows and macOS machines is not officially supported. What works well is using Linux
in a virtual machine, but at much lower performance than running Linux natively. We also offer Docker images.
For development on Windows, using the
[Windows Subsystem for Linux (WSL)](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux)
is a good option
([installation instructions here](https://docs.microsoft.com/en-us/windows/wsl/install)), but it
Expand Down
2 changes: 1 addition & 1 deletion doc/doxygen/src/mainpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RIOT is developed by an open community that anyone is welcome to join:
The quickest start {#the-quickest-start}
==================
You can run RIOT on most IoT devices, on open-access testbed hardware (e.g.
IoT-lab), and also directly as a process on your Linux/FreeBSD/macOS machine (we
IoT-lab), and also directly as a process on your Linux or FreeBSD machine (we
call this the `native` port). Try it right now in your terminal window:

~~~~~~~{.sh}
Expand Down