<feed xmlns='http://www.w3.org/2005/Atom'>
<title>opensbi.git/Makefile, branch v1.1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/opensbi.git/atom/Makefile?h=v1.1</id>
<link rel='self' href='http://cgit.235523.xyz/opensbi.git/atom/Makefile?h=v1.1'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/'/>
<updated>2022-05-13T03:56:00Z</updated>
<entry>
<title>Makefile: Add support for generating C array at compile time</title>
<updated>2022-05-13T03:56:00Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2022-05-13T03:56:00Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=7fb474b9dde5d56e0d4d6a0c1627337694cdc2f2'/>
<id>urn:sha1:7fb474b9dde5d56e0d4d6a0c1627337694cdc2f2</id>
<content type='text'>
Generating C array at compile time based on details provided by
objects.mk is a very useful feature which will help us compile
only a subset of drivers or modules.

We add a bash script (carray.sh) which takes array details and
object/variable list from command-line to generate a C source
containing array of object/variable pointers. We also extend
top-level makefile to use carray.sh whenever specified through
objects.mk.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Reviewed-by: Atish Patra &lt;atishp@rivosinc.com&gt;
</content>
</entry>
<entry>
<title>Makefile: Allow generated C source to be anywhere in build directory</title>
<updated>2022-05-13T03:55:50Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2022-05-13T03:55:50Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=f726f2dc0186964feb17296471233086bcc3d1b2'/>
<id>urn:sha1:f726f2dc0186964feb17296471233086bcc3d1b2</id>
<content type='text'>
The generated C source could be anywhere within build directory so
let us update the make rule to comple generated C source accordingly.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Reviewed-by: Atish Patra &lt;atishp@rivosinc.com&gt;
</content>
</entry>
<entry>
<title>Makefile: fix build with binutils 2.38</title>
<updated>2022-02-04T05:17:24Z</updated>
<author>
<name>Aurelien Jarno</name>
<email>aurelien@aurel32.net</email>
</author>
<published>2022-01-28T17:33:46Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=5d53b55aa77ffeefd4012445dfa6ad3535e1ff2c'/>
<id>urn:sha1:5d53b55aa77ffeefd4012445dfa6ad3535e1ff2c</id>
<content type='text'>
From version 2.38, binutils default to ISA spec version 20191213. This
means that the csr read/write (csrr*/csrw*) instructions and fence.i
instruction has separated from the `I` extension, become two standalone
extensions: Zicsr and Zifencei. As the kernel uses those instruction,
this causes the following build failure:

 CC        lib/sbi/sbi_tlb.o
&lt;&lt;BUILDDIR&gt;&gt;/lib/sbi/sbi_tlb.c: Assembler messages:
&lt;&lt;BUILDDIR&gt;&gt;/lib/sbi/sbi_tlb.c:190: Error: unrecognized opcode `fence.i'
make: *** [Makefile:431: &lt;&lt;BUILDDIR&gt;&gt;/build/lib/sbi/sbi_tlb.o] Error 1

The fix is to specify those extensions explicitly in -march. However as
older binutils version do not support this, we first need to detect
that.

Signed-off-by: Aurelien Jarno &lt;aurelien@aurel32.net&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Tested-by: Alexandre Ghiti &lt;alexandre.ghiti@canonical.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>Makefile: Improve the method to disable -m(no-)save-restore option</title>
<updated>2021-12-16T03:57:22Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2021-12-12T12:39:33Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=f27035981096e8d272d94dc17402b10567429869'/>
<id>urn:sha1:f27035981096e8d272d94dc17402b10567429869</id>
<content type='text'>
The commit 69d7e53 disables the -m(no-)save-restore option for
clang, but clang11 supports this option. This patch uses the
output information of the compiler to check whether the compiler
supports this option.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup.patel@wdc.com&gt;
</content>
</entry>
<entry>
<title>Makefile: Fix -msave-restore compile warning with CLANG-10 (or lower)</title>
<updated>2021-12-11T12:07:26Z</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2021-12-02T05:00:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=69d7e536138ae71a24028ca849d401a4d64d564b'/>
<id>urn:sha1:69d7e536138ae71a24028ca849d401a4d64d564b</id>
<content type='text'>
The riscv target of CLANG-10 (or lower) does not support the
-m(no-)save-restore option so we get compile warnings. This patch
fixes compile warning by using -m(no-)save-restore option only
for GCC.

Signed-off-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Reviewed-by: Dong Du &lt;Dd_nirvana@sjtu.edu.cn&gt;
</content>
</entry>
<entry>
<title>Makefile: Add build time and compiler info string</title>
<updated>2021-10-20T09:40:52Z</updated>
<author>
<name>Wei Fu</name>
<email>wefu@redhat.com</email>
</author>
<published>2021-09-30T10:11:20Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=422eda499cd6b69c0ca9f4cb06b3aceef17a3b27'/>
<id>urn:sha1:422eda499cd6b69c0ca9f4cb06b3aceef17a3b27</id>
<content type='text'>
When we are doing opensbi development, we want to know the build time
and compiler info for debug purpose.

To enable this message, please add "BUILD_INFO=y", like:

```
make BUILD_INFO=y
```

NOTE: Using `BUILD_INFO=y` without specifying SOURCE_DATE_EPOCH will
violate "reproducible builds". So it's ONLY for development and debug
purpose, and should NOT be used in a product which follows "reproducible
builds".

Signed-off-by: Wei Fu &lt;wefu@redhat.com&gt;
Reviewed-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Reviewed-by: Alistair Francis &lt;alistair.francis@wdc.com&gt;
</content>
</entry>
<entry>
<title>Makefile: Manually forward RELAX_FLAG to the assembler when linking with LLD</title>
<updated>2021-07-27T08:59:31Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2021-07-12T02:12:53Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=989039117fc0181bb971acf2c934d3fba454c153'/>
<id>urn:sha1:989039117fc0181bb971acf2c934d3fba454c153</id>
<content type='text'>
When generating code with -mno-relax, GCC puts .option norelax in
the generated assembly, and so doesn’t bother passing on -mno-relax
to the assembler. This has the unfortunate effect that, when using
GCC to assemble hand-written assembly, -mno-relax does nothing,
and we have to pass -Wa,-mno-relax to manually forward it to the
assembler.

This is an old GCC bug that was fixed [1] recently. For the time
being, let's pass "-Wa,-mno-relax" to ASFLAGS for the GCC + LLD
combination to work, e.g.:

  $ make CC=riscv64-unknown-elf-gcc LLVM=1 PLATFORM=generic

[1] https://github.com/gcc-mirror/gcc/commit/3b0a7d624e64eeb81e4d5e8c62c46d86ef521857

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Reviewed-by: Anup Patel &lt;anup.patel@wdc.com&gt;
</content>
</entry>
<entry>
<title>lib: utils: Drop dependency on libgcc by importing part of FreeBSD's libquad</title>
<updated>2021-07-11T15:31:44Z</updated>
<author>
<name>Jessica Clarke</name>
<email>jrtc27@jrtc27.com</email>
</author>
<published>2021-07-11T02:28:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=17729d44daf879e015950b0e9636afceefea0a59'/>
<id>urn:sha1:17729d44daf879e015950b0e9636afceefea0a59</id>
<content type='text'>
We only need libgcc for 64-bit division on RV32. Whilst GCC toolchains
bundle libgcc, Clang toolchains tend not to ship libclang_rt.builtins
given every compiler is a cross-compiler for every target and so you
would need a silly number of builds of it, with only the native library
available; only vendor-provided Clang toolchains specifically for bare
metal cross-compiling are likely to provide it.

Thus, import part of FreeBSD's implementation of the division support
functions needed and stop linking against libgcc.

Signed-off-by: Jessica Clarke &lt;jrtc27@jrtc27.com&gt;
Reviewed-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Tested-by: Anup Patel &lt;anup.patel@wdc.com&gt;
</content>
</entry>
<entry>
<title>Makefile: Support building with Clang and LLVM binutils</title>
<updated>2021-07-11T14:52:55Z</updated>
<author>
<name>Jessica Clarke</name>
<email>jrtc27@jrtc27.com</email>
</author>
<published>2021-07-11T02:28:23Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=2942777425516f7b31181fbaecc5485263dfcb01'/>
<id>urn:sha1:2942777425516f7b31181fbaecc5485263dfcb01</id>
<content type='text'>
This is intended to mirror the Linux kernel. Building with CC=clang will
use Clang as the compiler but default to using the existing binutils.
Building with LLVM=1 will default to using Clang and LLVM binutils.

Whilst GCC will accept the -N linker option and forward it on to the
linker, Clang will not, and so in order to support both compilers we
must use -Wl, to forward it to the linker as is required for most other
linker options.

Note that there is currently a bug when using Clang as the compiler and
riscv64-linux-gnu-ld as the linker for FW_PIC=y. At first glance this
appears to be a bug in GNU binutils, but this could also be Clang or
OpenSBI at fault in some subtle way. Thus, for now, advise that this
combination be avoided.

Signed-off-by: Jessica Clarke &lt;jrtc27@jrtc27.com&gt;
Reviewed-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Tested-by: Anup Patel &lt;anup.patel@wdc.com&gt;
</content>
</entry>
<entry>
<title>firmware: Only default FW_PIC to y if supported</title>
<updated>2021-07-11T14:33:06Z</updated>
<author>
<name>Jessica Clarke</name>
<email>jrtc27@jrtc27.com</email>
</author>
<published>2021-07-11T02:28:22Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=09ad811ec4661b99a67b87f28c93177367ae911e'/>
<id>urn:sha1:09ad811ec4661b99a67b87f28c93177367ae911e</id>
<content type='text'>
Bare-metal GNU ld does not support PIE, so if using it this will result
in a failure to build. Instead, default to FW_PIC=n if not supported.
Note that an explicit FW_PIC=y is not overridden, to ensure the build
fails rather than silently producing a position-dependent binary.

Signed-off-by: Jessica Clarke &lt;jrtc27@jrtc27.com&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Tested-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Reviewed-by: Anup Patel &lt;anup.patel@wdc.com&gt;
</content>
</entry>
</feed>
