cmake(bugfix):add x86_64 arch cmake loadable mod support

supplementing the implementation of loadable construction for x86

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
xuxin19
2025-06-09 16:19:18 +08:00
committed by GUIDINGLI
parent 63dc48e713
commit f589a02e3e
2 changed files with 34 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
# ##############################################################################
# arch/x86_64/src/cmake/elf.cmake
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
# Loadable and ELF module settings
nuttx_elf_compile_options(-fvisibility=hidden -fno-pic -mcmodel=large)
nuttx_elf_link_options(-r)
nuttx_elf_link_options_ifdef(CONFIG_DEBUG_OPT_UNUSED_SECTIONS --gc-sections)
+7
View File
@@ -79,3 +79,10 @@ if(CONFIG_ARCH_HAVE_DEBUG)
endif()
target_sources(arch PRIVATE ${SRCS})
nuttx_add_aux_library(STARTUP_OBJS crt0.c)
target_compile_options(
STARTUP_OBJS
PRIVATE
$<GENEX_EVAL:$<TARGET_PROPERTY:nuttx_global,NUTTX_ELF_APP_COMPILE_OPTIONS>>)