From patchwork Fri Dec 29 05:04:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82971 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F30033858D33 for ; Fri, 29 Dec 2023 05:05:08 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id CF4E73858D28 for ; Fri, 29 Dec 2023 05:04:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF4E73858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CF4E73858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703826291; cv=none; b=VX+UeRpT6Tl5LLbj12ySuRkKrkfMKQtj1d20xqTxB2mlDbdIi5TRDPZCU/7Ep2zr5e9wRAQN+lOCgV7IRcmFZW779hbV+05ubVKkMtnohr8bzwOpJDTqewekIJsqlzK2e5IiGl5PkAKZ6g7VNw0Xxi9ZP3+0bRXXpTsdQ4Qio/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703826291; c=relaxed/simple; bh=b539dkDQpzw3AW1phVVZiSTqt4noPc2CtmhiQzhN3wU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=tDL8vG2RD3halrzgLkRtGl4eiJ87J28r2KqJnd9AJA1aH6F84b7n0ro216ixE/p8MqqCj8Q1yvU79UUjkZsMyqmZ74yow8eAWQaGCc4wtbqtI9e3SX8axLX++VbZrTIlKifX9BBwaGLjWJqqOMWDQ8nHa6IYICwtOginUMoNmYQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id D353D340CC9; Fri, 29 Dec 2023 05:04:47 +0000 (UTC) From: Mike Frysinger To: newlib@sourceware.org Subject: [PATCH] libgloss: merge or1k into top-level Makefile Date: Fri, 29 Dec 2023 00:04:45 -0500 Message-ID: <20231229050445.9590-1-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces+patchwork=sourceware.org@sourceware.org Avoid a recursive make to speed things up a bit. A or1k-elf build shows installed objects & libs produce same code. --- libgloss/Makefile.am | 3 + libgloss/Makefile.in | 448 ++++++++++++++++++++++++++++-------- libgloss/configure | 19 +- libgloss/configure.ac | 5 +- libgloss/or1k/Makefile.in | 145 ------------ libgloss/or1k/Makefile.inc | 66 ++++++ libgloss/or1k/boards/README | 5 +- 7 files changed, 436 insertions(+), 255 deletions(-) delete mode 100644 libgloss/or1k/Makefile.in create mode 100644 libgloss/or1k/Makefile.inc diff --git a/libgloss/Makefile.am b/libgloss/Makefile.am index 00a637a13831..e685be708abe 100644 --- a/libgloss/Makefile.am +++ b/libgloss/Makefile.am @@ -126,6 +126,9 @@ endif if CONFIG_NIOS2 include nios2/Makefile.inc endif +if CONFIG_OR1K +include or1k/Makefile.inc +endif if CONFIG_RISCV include riscv/Makefile.inc endif diff --git a/libgloss/configure.ac b/libgloss/configure.ac index 8856e9c0ff11..165e56b48237 100644 --- a/libgloss/configure.ac +++ b/libgloss/configure.ac @@ -215,8 +215,7 @@ case "${target}" in config_iq2000=true ;; or1k-*-* | or1knd-*-* ) - AC_CONFIG_FILES([or1k/Makefile]) - subdirs="$subdirs or1k" + config_or1k=true ;; pru-*-*) AC_CONFIG_FILES([pru/Makefile]) @@ -233,7 +232,7 @@ dnl the ports above will too! m4_foreach_w([SUBDIR], [ aarch64 arc arm bfin csky d30v epiphany frv i386 i960 iq2000 libnosys lm32 m32r mcore mn10200 mn10300 moxie msp430 - nds32 nios2 riscv rl78 rx v850 visium wince xstormy16 xtensa + nds32 nios2 or1k riscv rl78 rx v850 visium wince xstormy16 xtensa ], [dnl AM_CONDITIONAL([CONFIG_]m4_toupper(SUBDIR), [test x$config_]SUBDIR = xtrue) ]) diff --git a/libgloss/or1k/Makefile.in b/libgloss/or1k/Makefile.in deleted file mode 100644 index c75d6e454633..000000000000 --- a/libgloss/or1k/Makefile.in +++ /dev/null @@ -1,145 +0,0 @@ -# Copyright (c) 1998 Cygnus Support -# -# The authors hereby grant permission to use, copy, modify, distribute, -# and license this software and its documentation for any purpose, provided -# that existing copyright notices are retained in all copies and that this -# notice is included verbatim in any distributions. No written agreement, -# license, or royalty fee is required for any of the authorized uses. -# Modifications to this software may be copyrighted by their authors -# and need not follow the licensing terms described here, provided that -# the new terms are clearly indicated on the first page of each file where -# they apply. - -DESTDIR = -VPATH = @srcdir@ -srcdir = @srcdir@ -objdir = . -srcroot = $(srcdir)/../.. -objroot = $(objdir)/../.. - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -host_alias = @host_alias@ -target_alias = @target_alias@ -program_transform_name = @program_transform_name@ - -bindir = @bindir@ -libdir = @libdir@ -includedir = @includedir@ -tooldir = $(exec_prefix)/$(target_alias) - -# Multilib support variables. -# TOP is used instead of MULTI{BUILD,SRC}TOP. -MULTIDIRS = -MULTISUBDIR = -MULTIDO = true -MULTICLEAN = true - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ - -SHELL = /bin/sh - -mkinstalldirs = $(SHELL) $(srcroot)/mkinstalldirs - -CC = @CC@ -AS = @AS@ -AR = @AR@ -LD = @LD@ -RANLIB = @RANLIB@ - -OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ - then echo ${objroot}/../binutils/objdump ; \ - else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` -OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ - then echo ${objroot}/../binutils/objcopy ; \ - else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` - -# object files needed -COMMON_FILES = syscalls \ - or1k_uart \ - outbyte \ - caches-asm \ - exceptions \ - exceptions-asm \ - interrupts \ - interrupts-asm \ - mmu-asm \ - timer \ - sbrk \ - impure \ - util \ - sync-asm - -LIBOR1K_FILES = $(COMMON_FILES) -LIBOR1K_OBJS = $(addsuffix .o,$(LIBOR1K_FILES)) - -BOARDS = atlys \ - de0_nano \ - ml501 \ - optimsoc \ - or1ksim \ - or1ksim-uart \ - ordb1a3pe1500 \ - ordb2a \ - orpsocrefdesign - -BOARD_LIBS = $(addprefix libboard-,$(addsuffix .a,$(BOARDS))) -BOARD_OBJS = $(addprefix libboard-,$(addsuffix .o,$(BOARDS))) - -GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \ - then echo -L${objroot}/../gcc ; fi` - -OUTPUTS = libor1k.a crt0.o ${BOARD_LIBS} - -# Host specific makefile fragment comes in here. -@host_makefile_frag@ - - -all: ${OUTPUTS} - -# -# here's where we build the library for each target -# - -libor1k.a: $(LIBOR1K_OBJS) - ${AR} ${ARFLAGS} $@ $(LIBOR1K_OBJS) - ${RANLIB} $@ - -libboard-%.o: boards/%.S - ${CC} ${CFLAGS} -o $@ -c $< - -libboard-%.o: boards/%.c - ${CC} ${CFLAGS} -o $@ -c $< - -libboard-%.a: libboard-%.o - ${AR} ${ARFLAGS} $@ $< - ${RANLIB} $@ - -doc: - -clean mostlyclean: - rm -f $(OUTPUTS) $(BOARD_LIBS) *.i *~ *.o *-test *.srec *.dis *.map *.x - -distclean maintainer-clean realclean: clean - rm -f Makefile config.status $(OUTPUTS) - -.PHONY: install info install-info clean-info -install: - ${mkinstalldirs} ${DESTDIR}${tooldir}/lib${MULTISUBDIR} $(DESTDIR)$(tooldir)/include - @for outputs in ${OUTPUTS}; do\ - $(INSTALL_DATA) $${outputs} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \ - done - $(INSTALL_DATA) ${srcdir}/include/or1k-support.h $(DESTDIR)$(tooldir)/include/ - $(INSTALL_DATA) ${srcdir}/include/or1k-sprs.h $(DESTDIR)$(tooldir)/include/ - $(INSTALL_DATA) ${srcdir}/include/or1k-asm.h $(DESTDIR)$(tooldir)/include/ - $(INSTALL_DATA) ${srcdir}/include/or1k-nop.h $(DESTDIR)$(tooldir)/include/ - -info: -install-info: -clean-info: - -Makefile: Makefile.in ../config.status - cd .. && $(SHELL) config.status diff --git a/libgloss/or1k/Makefile.inc b/libgloss/or1k/Makefile.inc new file mode 100644 index 000000000000..ecb7a83df52f --- /dev/null +++ b/libgloss/or1k/Makefile.inc @@ -0,0 +1,66 @@ +## Copyright (c) 1998 Cygnus Support +## +## The authors hereby grant permission to use, copy, modify, distribute, +## and license this software and its documentation for any purpose, provided +## that existing copyright notices are retained in all copies and that this +## notice is included verbatim in any distributions. No written agreement, +## license, or royalty fee is required for any of the authorized uses. +## Modifications to this software may be copyrighted by their authors +## and need not follow the licensing terms described here, provided that +## the new terms are clearly indicated on the first page of each file where +## they apply. + +multilibtool_DATA += %D%/crt0.o +libobjs_a_SOURCES += %D%/crt0.S + +includetool_DATA += \ + %D%/include/or1k-asm.h \ + %D%/include/or1k-nop.h \ + %D%/include/or1k-sprs.h \ + %D%/include/or1k-support.h + +multilibtool_LIBRARIES += %D%/libor1k.a +%C%_libor1k_a_SOURCES = \ + %D%/syscalls.c \ + %D%/or1k_uart.c \ + %D%/outbyte.c \ + %D%/caches-asm.S \ + %D%/exceptions.c \ + %D%/exceptions-asm.S \ + %D%/interrupts.c \ + %D%/interrupts-asm.S \ + %D%/mmu-asm.S \ + %D%/timer.c \ + %D%/sbrk.c \ + %D%/impure.c \ + %D%/util.c \ + %D%/sync-asm.S + +## Now all the board definitions. + +multilibtool_LIBRARIES += %D%/libboard-atlys.a +%C%_libboard_atlys_a_SOURCES = %D%/boards/atlys.S + +multilibtool_LIBRARIES += %D%/libboard-de0_nano.a +%C%_libboard_de0_nano_a_SOURCES = %D%/boards/de0_nano.S + +multilibtool_LIBRARIES += %D%/libboard-ml501.a +%C%_libboard_ml501_a_SOURCES = %D%/boards/ml501.S + +multilibtool_LIBRARIES += %D%/libboard-optimsoc.a +%C%_libboard_optimsoc_a_SOURCES = %D%/boards/optimsoc.S + +multilibtool_LIBRARIES += %D%/libboard-or1ksim.a +%C%_libboard_or1ksim_a_SOURCES = %D%/boards/or1ksim.S + +multilibtool_LIBRARIES += %D%/libboard-or1ksim-uart.a +%C%_libboard_or1ksim_uart_a_SOURCES = %D%/boards/or1ksim-uart.S + +multilibtool_LIBRARIES += %D%/libboard-ordb1a3pe1500.a +%C%_libboard_ordb1a3pe1500_a_SOURCES = %D%/boards/ordb1a3pe1500.S + +multilibtool_LIBRARIES += %D%/libboard-ordb2a.a +%C%_libboard_ordb2a_a_SOURCES = %D%/boards/ordb2a.S + +multilibtool_LIBRARIES += %D%/libboard-orpsocrefdesign.a +%C%_libboard_orpsocrefdesign_a_SOURCES = %D%/boards/orpsocrefdesign.S diff --git a/libgloss/or1k/boards/README b/libgloss/or1k/boards/README index b6c5abf92c52..290b798b5552 100644 --- a/libgloss/or1k/boards/README +++ b/libgloss/or1k/boards/README @@ -60,6 +60,5 @@ steps: implementation. It is recommended to do so in assembler board files to keep the ability to overwrite the default implementation by the user. -When you are done with your board, add it to libgloss/or1k/Makefile.in to the -BOARDS variable and compile. - +When you are done with your board, add it to libgloss/or1k/Makefile.inc like the +other libboard-*.a definitions and compile.