From ae071920b4e539a56e9a6ea24a1be71ec5a9c1cf Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 22 Jun 2025 14:03:16 +0800 Subject: [PATCH] libc/machine/riscv: Move all source files out of gnu folder and remove the empty CMakeLists.txt in the subdirectories. Signed-off-by: Xiang Xiao --- libs/libc/machine/risc-v/CMakeLists.txt | 25 +++++++---- libs/libc/machine/risc-v/Make.defs | 5 --- .../machine/risc-v/{gnu => }/arch_memcpy.S | 2 +- .../machine/risc-v/{gnu => }/arch_memset.S | 2 +- .../machine/risc-v/{gnu => }/arch_setjmp.S | 2 +- .../machine/risc-v/{gnu => }/arch_strcmp.S | 2 +- libs/libc/machine/risc-v/{gnu => }/asm.h | 2 +- .../libc/machine/risc-v/common/CMakeLists.txt | 21 ---------- libs/libc/machine/risc-v/gnu/CMakeLists.txt | 41 ------------------- libs/libc/machine/risc-v/rv32/CMakeLists.txt | 21 ---------- libs/libc/machine/risc-v/rv64/CMakeLists.txt | 22 ---------- 11 files changed, 21 insertions(+), 124 deletions(-) rename libs/libc/machine/risc-v/{gnu => }/arch_memcpy.S (98%) rename libs/libc/machine/risc-v/{gnu => }/arch_memset.S (97%) rename libs/libc/machine/risc-v/{gnu => }/arch_setjmp.S (98%) rename libs/libc/machine/risc-v/{gnu => }/arch_strcmp.S (98%) rename libs/libc/machine/risc-v/{gnu => }/asm.h (97%) delete mode 100644 libs/libc/machine/risc-v/common/CMakeLists.txt delete mode 100644 libs/libc/machine/risc-v/gnu/CMakeLists.txt delete mode 100644 libs/libc/machine/risc-v/rv32/CMakeLists.txt delete mode 100644 libs/libc/machine/risc-v/rv64/CMakeLists.txt diff --git a/libs/libc/machine/risc-v/CMakeLists.txt b/libs/libc/machine/risc-v/CMakeLists.txt index 032040f291..93ef36ef3d 100644 --- a/libs/libc/machine/risc-v/CMakeLists.txt +++ b/libs/libc/machine/risc-v/CMakeLists.txt @@ -17,18 +17,25 @@ # the License. # # ############################################################################## -add_subdirectory(gnu) - -if(CONFIG_ARCH_RV64GC) - add_subdirectory(rv64) -endif() - -if(CONFIG_ARCH_RV32IM) - add_subdirectory(rv32) -endif() set(SRCS) +if(CONFIG_RISCV_MEMCPY) + list(APPEND SRCS arch_memcpy.S) +endif() + +if(CONFIG_RISCV_MEMSET) + list(APPEND SRCS arch_memset.S) +endif() + +if(CONFIG_RISCV_STRCMP) + list(APPEND SRCS arch_strcmp.S) +endif() + +if(CONFIG_ARCH_SETJMP_H) + list(APPEND SRCS arch_setjmp.S) +endif() + if(CONFIG_LIBC_ARCH_ELF) list(APPEND SRCS arch_elf.c) endif() diff --git a/libs/libc/machine/risc-v/Make.defs b/libs/libc/machine/risc-v/Make.defs index f4d9d172c1..ec76a24eed 100644 --- a/libs/libc/machine/risc-v/Make.defs +++ b/libs/libc/machine/risc-v/Make.defs @@ -40,10 +40,5 @@ ifeq ($(CONFIG_LIBC_ARCH_ELF),y) CSRCS += arch_elf.c endif -ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y) -DEPPATH += --dep-path machine/risc-v/gnu -VPATH += :machine/risc-v/gnu -endif - DEPPATH += --dep-path machine/risc-v VPATH += :machine/risc-v diff --git a/libs/libc/machine/risc-v/gnu/arch_memcpy.S b/libs/libc/machine/risc-v/arch_memcpy.S similarity index 98% rename from libs/libc/machine/risc-v/gnu/arch_memcpy.S rename to libs/libc/machine/risc-v/arch_memcpy.S index 92772bcd6f..70615f20b7 100644 --- a/libs/libc/machine/risc-v/gnu/arch_memcpy.S +++ b/libs/libc/machine/risc-v/arch_memcpy.S @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libc/machine/risc-v/gnu/arch_memcpy.S + * libs/libc/machine/risc-v/arch_memcpy.S * * SPDX-License-Identifier: Apache-2.0 * diff --git a/libs/libc/machine/risc-v/gnu/arch_memset.S b/libs/libc/machine/risc-v/arch_memset.S similarity index 97% rename from libs/libc/machine/risc-v/gnu/arch_memset.S rename to libs/libc/machine/risc-v/arch_memset.S index 9b490d9a58..709814f08a 100644 --- a/libs/libc/machine/risc-v/gnu/arch_memset.S +++ b/libs/libc/machine/risc-v/arch_memset.S @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libc/machine/risc-v/gnu/arch_memset.S + * libs/libc/machine/risc-v/arch_memset.S * * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * SPDX-FileCopyrightText: 2017 SiFive Inc. All rights reserved. diff --git a/libs/libc/machine/risc-v/gnu/arch_setjmp.S b/libs/libc/machine/risc-v/arch_setjmp.S similarity index 98% rename from libs/libc/machine/risc-v/gnu/arch_setjmp.S rename to libs/libc/machine/risc-v/arch_setjmp.S index b5c534fe9d..d5b254d164 100644 --- a/libs/libc/machine/risc-v/gnu/arch_setjmp.S +++ b/libs/libc/machine/risc-v/arch_setjmp.S @@ -1,5 +1,5 @@ ############################################################################ -# libs/libc/machine/risc-v/gnu/arch_setjmp.S +# libs/libc/machine/risc-v/arch_setjmp.S # # SPDX-License-Identifier: Apache-2.0 # diff --git a/libs/libc/machine/risc-v/gnu/arch_strcmp.S b/libs/libc/machine/risc-v/arch_strcmp.S similarity index 98% rename from libs/libc/machine/risc-v/gnu/arch_strcmp.S rename to libs/libc/machine/risc-v/arch_strcmp.S index 9ecd092f13..3f426d00c0 100644 --- a/libs/libc/machine/risc-v/gnu/arch_strcmp.S +++ b/libs/libc/machine/risc-v/arch_strcmp.S @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libc/machine/risc-v/gnu/arch_strcmp.S + * libs/libc/machine/risc-v/arch_strcmp.S * * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * SPDX-FileCopyrightText: 2017 SiFive Inc. All rights reserved. diff --git a/libs/libc/machine/risc-v/gnu/asm.h b/libs/libc/machine/risc-v/asm.h similarity index 97% rename from libs/libc/machine/risc-v/gnu/asm.h rename to libs/libc/machine/risc-v/asm.h index 673cb9c0b1..be8da27735 100644 --- a/libs/libc/machine/risc-v/gnu/asm.h +++ b/libs/libc/machine/risc-v/asm.h @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libc/machine/risc-v/gnu/asm.h + * libs/libc/machine/risc-v/asm.h * * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * SPDX-FileCopyrightText: 2017 SiFive Inc. All rights reserved. diff --git a/libs/libc/machine/risc-v/common/CMakeLists.txt b/libs/libc/machine/risc-v/common/CMakeLists.txt deleted file mode 100644 index f4e18e4867..0000000000 --- a/libs/libc/machine/risc-v/common/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -# ############################################################################## -# libs/libc/machine/risc-v/common/CMakeLists.txt -# -# SPDX-License-Identifier: Apache-2.0 -# -# 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. -# -# ############################################################################## diff --git a/libs/libc/machine/risc-v/gnu/CMakeLists.txt b/libs/libc/machine/risc-v/gnu/CMakeLists.txt deleted file mode 100644 index 188ffac6b5..0000000000 --- a/libs/libc/machine/risc-v/gnu/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -# ############################################################################## -# libs/libc/machine/risc-v/gnu/CMakeLists.txt -# -# SPDX-License-Identifier: Apache-2.0 -# -# 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. -# -# ############################################################################## - -set(SRCS) - -if(CONFIG_RISCV_MEMCPY) - list(APPEND SRCS arch_memcpy.S) -endif() - -if(CONFIG_RISCV_MEMSET) - list(APPEND SRCS arch_memset.S) -endif() - -if(CONFIG_RISCV_STRCMP) - list(APPEND SRCS arch_strcmp.S) -endif() - -if(CONFIG_ARCH_SETJMP_H) - list(APPEND SRCS arch_setjmp.S) -endif() - -target_sources(c PRIVATE ${SRCS}) diff --git a/libs/libc/machine/risc-v/rv32/CMakeLists.txt b/libs/libc/machine/risc-v/rv32/CMakeLists.txt deleted file mode 100644 index 9d0a85b3ea..0000000000 --- a/libs/libc/machine/risc-v/rv32/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -# ############################################################################## -# libs/libc/machine/risc-v/rv32/CMakeLists.txt -# -# SPDX-License-Identifier: Apache-2.0 -# -# 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. -# -# ############################################################################## diff --git a/libs/libc/machine/risc-v/rv64/CMakeLists.txt b/libs/libc/machine/risc-v/rv64/CMakeLists.txt deleted file mode 100644 index 345f73fd8a..0000000000 --- a/libs/libc/machine/risc-v/rv64/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -# ############################################################################## -# libs/libc/machine/risc-v/rv64/CMakeLists.txt -# -# SPDX-License-Identifier: Apache-2.0 -# -# 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. -# -# ############################################################################## -