aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author浅倉麗子2020-08-17 17:42:01 -0400
committer浅倉麗子2020-08-17 17:42:01 -0400
commit1c0f7eee98df1b2873a11a6da613bd5119c51d1a (patch)
treec030a061e10c44500f311ff1d0e98f09a1d3c578
parentFix file log and set short title (diff)
downloadsharpscale-1c0f7eee98df1b2873a11a6da613bd5119c51d1a.tar.gz
Enable LTO globally
-rw-r--r--CMakeLists.txt2
-rw-r--r--config-app/CMakeLists.txt2
-rw-r--r--config.c5
-rw-r--r--include/common.h1
-rw-r--r--main.c4
-rw-r--r--scaling-test/CMakeLists.txt2
6 files changed, 7 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 99062a5..73e4138 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,7 +25,7 @@ add_compile_options(
-Os -std=c99
-Wall -Wextra -Wdouble-promotion -Wshadow -Wundef
-fsingle-precision-constant -fno-common
- -ftree-vectorize -funsafe-math-optimizations
+ -ftree-vectorize -funsafe-math-optimizations -flto
)
add_link_options(
diff --git a/config-app/CMakeLists.txt b/config-app/CMakeLists.txt
index bcd6e9e..854d716 100644
--- a/config-app/CMakeLists.txt
+++ b/config-app/CMakeLists.txt
@@ -13,8 +13,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-add_compile_options(-flto)
-
if(FILELOG_ENABLE)
set(LOG_PREFIX "[SharpscaleConfiguration] ")
else()
diff --git a/config.c b/config.c
index 69d6758..16b1490 100644
--- a/config.c
+++ b/config.c
@@ -23,6 +23,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <psp2dbg.h>
+#include "common.h"
#include "config.h"
#include "sharpscale_internal.h"
@@ -125,7 +126,7 @@ fail:
return -1;
}
-int SharpscaleGetConfig(SharpscaleConfig *config) {
+USED int SharpscaleGetConfig(SharpscaleConfig *config) {
if (!is_config_valid(&ss_config)) { goto fail; }
if (ksceKernelMemcpyKernelToUser((uintptr_t)config, &ss_config, sizeof(*config)) < 0) { goto fail; }
@@ -137,7 +138,7 @@ fail:
return -1;
}
-int SharpscaleSetConfig(SharpscaleConfig *config) {
+USED int SharpscaleSetConfig(SharpscaleConfig *config) {
SharpscaleConfig kconfig;
if (ksceKernelMemcpyUserToKernel(&kconfig, (uintptr_t)config, sizeof(kconfig)) < 0) { goto fail; }
if (!is_config_valid(&kconfig)) { goto fail; }
diff --git a/include/common.h b/include/common.h
index 0c59cde..c839aa6 100644
--- a/include/common.h
+++ b/include/common.h
@@ -27,5 +27,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#define ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1))
#define UNUSED __attribute__ ((unused))
+#define USED __attribute__ ((used))
#endif
diff --git a/main.c b/main.c
index 6a69bd0..8f5f5dc 100644
--- a/main.c
+++ b/main.c
@@ -312,7 +312,7 @@ static void cleanup(void) {
SCE_DBG_FILELOG_TERM();
}
-int module_start(UNUSED SceSize args, UNUSED const void *argp) {
+USED int module_start(UNUSED SceSize args, UNUSED const void *argp) {
int ret;
startup();
@@ -350,7 +350,7 @@ fail:
return SCE_KERNEL_START_FAILED;
}
-int module_stop(UNUSED SceSize args, UNUSED const void *argp) {
+USED int module_stop(UNUSED SceSize args, UNUSED const void *argp) {
cleanup();
return SCE_KERNEL_STOP_SUCCESS;
}
diff --git a/scaling-test/CMakeLists.txt b/scaling-test/CMakeLists.txt
index 3701034..f8e8be6 100644
--- a/scaling-test/CMakeLists.txt
+++ b/scaling-test/CMakeLists.txt
@@ -13,8 +13,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-add_compile_options(-flto)
-
if(FILELOG_ENABLE)
set(LOG_PREFIX "[SharpscaleScalingTest] ")
set(PROGRAM_AUTHORITY "UNSAFE")