Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Nov 2023 19:21:45 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: a864243fb7ae - main - sysutils/opensbi: fix build with clang 17
Message-ID:  <202311251921.3APJLja7052468@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a864243fb7ae1932341fce17598cfc588150156d

commit a864243fb7ae1932341fce17598cfc588150156d
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-11-25 19:15:54 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-11-25 19:21:34 +0000

    sysutils/opensbi: fix build with clang 17
    
    Building sysutils/opensbi with clang 17 results in the following errors:
    
      clang: error: unsupported option '-mno-unaligned-access' for target 'riscv64-unknown-elf'
      clang: error: unsupported option '-mno-unaligned-access' for target 'riscv64-unknown-elf'
      [... many more times...]
    
    The target-specific option -mno-unaligned-access (which is emitted from
    the compiler driver when -mstrict-align is used) did not do anything for
    riscv64, but clang 17 is now more strict about reporting unsupported
    options. Remove the -mstrict-align option from the Makefile's CFLAGS and
    ASFLAGS to fix it.
    
    PR:             273753
    MFH:            2023Q4
---
 sysutils/opensbi/files/patch-Makefile | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/sysutils/opensbi/files/patch-Makefile b/sysutils/opensbi/files/patch-Makefile
new file mode 100644
index 000000000000..e98a465c25da
--- /dev/null
+++ b/sysutils/opensbi/files/patch-Makefile
@@ -0,0 +1,20 @@
+--- Makefile.orig	2023-07-19 06:21:59 UTC
++++ Makefile
+@@ -337,7 +337,7 @@ endif
+ else
+ CFLAGS		+=	-O2
+ endif
+-CFLAGS		+=	-fno-omit-frame-pointer -fno-optimize-sibling-calls -mstrict-align
++CFLAGS		+=	-fno-omit-frame-pointer -fno-optimize-sibling-calls
+ # enable -m(no-)save-restore option by CC_SUPPORT_SAVE_RESTORE
+ ifeq ($(CC_SUPPORT_SAVE_RESTORE),y)
+ CFLAGS		+=	-mno-save-restore
+@@ -355,7 +355,7 @@ ASFLAGS		=	-g -Wall -nostdlib
+ CPPFLAGS	+=	$(firmware-cppflags-y)
+ 
+ ASFLAGS		=	-g -Wall -nostdlib
+-ASFLAGS		+=	-fno-omit-frame-pointer -fno-optimize-sibling-calls -mstrict-align
++ASFLAGS		+=	-fno-omit-frame-pointer -fno-optimize-sibling-calls
+ # enable -m(no-)save-restore option by CC_SUPPORT_SAVE_RESTORE
+ ifeq ($(CC_SUPPORT_SAVE_RESTORE),y)
+ ASFLAGS		+=	-mno-save-restore



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202311251921.3APJLja7052468>