1
Fork 0

Use -fsingle-precision-constant for MOD builds

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-01-26 21:57:02 +00:00
parent 8d9acc3d65
commit 14a2cb153e
No known key found for this signature in database
GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 65 additions and 3 deletions

View File

@ -95,7 +95,23 @@ endif
# MOD builds
MOD_WORKDIR ?= $(HOME)/mod-workdir
MOD_ENVIRONMENT = AR=${1}/host/usr/bin/${2}-gcc-ar CC=${1}/host/usr/bin/${2}-gcc CPP=${1}/host/usr/bin/${2}-cpp CXX=${1}/host/usr/bin/${2}-g++ LD=${1}/host/usr/bin/${2}-ld PKG_CONFIG=${1}/host/usr/bin/pkg-config STRIP=${1}/host/usr/bin/${2}-strip CFLAGS="-I${1}/staging/usr/include" CPPFLAGS= CXXFLAGS="-I${1}/staging/usr/include" LDFLAGS="-L${1}/staging/usr/lib" \ EXE_WRAPPER="qemu-${3}-static -L ${1}/target" HEADLESS=true MOD_BUILD=true NOOPT=true STATIC_BUILD=true
MOD_ENVIRONMENT = \
AR=${1}/host/usr/bin/${2}-gcc-ar \
CC=${1}/host/usr/bin/${2}-gcc \
CPP=${1}/host/usr/bin/${2}-cpp \
CXX=${1}/host/usr/bin/${2}-g++ \
LD=${1}/host/usr/bin/${2}-ld \
PKG_CONFIG=${1}/host/usr/bin/pkg-config \
STRIP=${1}/host/usr/bin/${2}-strip \
CFLAGS="-I${1}/staging/usr/include -fsingle-precision-constant" \
CPPFLAGS= \
CXXFLAGS="-I${1}/staging/usr/include -I../include/single-precision -fsingle-precision-constant -Wno-attributes" \
LDFLAGS="-L${1}/staging/usr/lib" \
EXE_WRAPPER="qemu-${3}-static -L ${1}/target" \
HEADLESS=true \
MOD_BUILD=true \
NOOPT=true \
STATIC_BUILD=true
modduo:
$(MAKE) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR)/modduo-static,arm-mod-linux-gnueabihf.static,arm)

View File

@ -0,0 +1,46 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the LICENSE file.
*/
#pragma once
#include_next <algorithm>
#include_next <complex>
namespace std {
static inline
float max(const float a, const double b) {
return std::max<float>(a, static_cast<float>(b));
}
static inline
std::complex<float> operator*(const std::complex<double>& a, const float b) {
return static_cast<std::complex<float>>(a) * b;
}
static inline
std::complex<float> operator*(const float a, const std::complex<double>& b) {
return a * static_cast<std::complex<float>>(b);
}
static inline
std::complex<float> operator/(const std::complex<double>& a, const std::complex<float>& b) {
return static_cast<std::complex<float>>(a) / b;
}
}
// std::complex<double>

@ -1 +1 @@
Subproject commit c7eb417fa18fd87fe4e49eee22af1ed51547a4ce
Subproject commit 0a6c390eedf98884393f82cb066038a78a316ea5

@ -1 +1 @@
Subproject commit b8fbeae247f873cd20a3a2598907c4391f0d8171
Subproject commit 185e07ea94086a04b3daacb4bf94c0fbd3544725