Displaying 12 results from an estimated 12 matches for "ld_image_base_opt".
2020 Jul 25
0
[klibc:master] Kbuild: support clang's lld
...eletions(-)
diff --git a/Makefile b/Makefile
index c99b962f..c8325154 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,9 @@ export NM := $(KLIBCROSS)nm
export OBJCOPY := $(KLIBCROSS)objcopy
export OBJDUMP := $(KLIBCROSS)objdump
+LLD := $(shell $(LD) --version 2>&1 | grep LLD)
+export LD_IMAGE_BASE_OPT=$(if $(LLD),--image-base,-Ttext-segment)
+
NOSTDINC_FLAGS := -nostdlib -nostdinc -isystem $(shell $(CC) -print-file-name=include)
ARCH := $(shell uname -m | sed -e s/i.86/i386/ \
diff --git a/usr/klibc/arch/i386/MCONFIG b/usr/klibc/arch/i386/MCONFIG
index c7d3fccd..e6f50dde 100644
---...
2020 Mar 29
7
[kvm-unit-tests PATCH v3 0/4] Update patch set
- Renamed IMAGE_BASE to LD_IMAGE_BASE_OPT.
- Moved "-fcommon" to KLIBCREQFLAGS in scripts/Kbuild.klibc.
- Remove "dash" warning fixes which have been upstreamed.
- Conditionalize the inclusion of compiler flags by using the proper
compiler name or "cc-option".
- Added "-Werror" to "cc-option&q...
2020 Oct 13
1
[PATCH] klibc: support llvm's lld for arm64
Use $(LD_IMAGE_BASE_OPT) instead of hardcoding --Ttext-segment,
which lld does not support. This allows either --Ttext-segment
or -image-base to be emitted based on the linker.
Signed-off-by: Andrew Delgadillo <adelg at google.com>
---
usr/klibc/arch/arm64/MCONFIG | 2 +-
1 file changed, 1 insertion(+), 1 deletion...
2020 Jul 25
2
[kvm-unit-tests PATCH v3 0/4] Update patch set
On Sat, 2020-07-25 at 17:47 +0100, Ben Hutchings wrote:
> On Sun, 2020-03-29 at 04:38 -0700, Bill Wendling wrote:
> > - Renamed IMAGE_BASE to LD_IMAGE_BASE_OPT.
> > - Moved "-fcommon" to KLIBCREQFLAGS in scripts/Kbuild.klibc.
> > - Remove "dash" warning fixes which have been upstreamed.
> > - Conditionalize the inclusion of compiler flags by using the proper
> > compiler name or "cc-option".
> >...
2023 Mar 05
0
[klibc:master] Add LoongArch64 port
...ion of the library
# This address needs to be reachable using normal inter-module
# calls, and work on the memory models for this architecture
-# Normal binaries start at 1 MB; the linker wants 1 MB alignment,
-# and call instructions have a 30-bit signed offset, << 2.
-KLIBCSHAREDFLAGS = $(LD_IMAGE_BASE_OPT) 0x80000000
+# 4862 MB - normal binaries start at 4608 MB. Non-PIC jumps usually
+# use the BL instruction which requires a destination between -128M
+# to 128M. Since we can't put ourselves below the normal load
+# address, use the very top of the 128M region (minus 2MB)
+KLIBCSHAREDFLAGS = $...
2020 Jul 25
0
[kvm-unit-tests PATCH v3 0/4] Update patch set
On Sun, 2020-03-29 at 04:38 -0700, Bill Wendling wrote:
> - Renamed IMAGE_BASE to LD_IMAGE_BASE_OPT.
> - Moved "-fcommon" to KLIBCREQFLAGS in scripts/Kbuild.klibc.
> - Remove "dash" warning fixes which have been upstreamed.
> - Conditionalize the inclusion of compiler flags by using the proper
> compiler name or "cc-option".
> - Added "-Werror&q...
2020 Jul 25
0
[kvm-unit-tests PATCH v3 0/4] Update patch set
On Sat, Jul 25, 2020 at 1:57 PM Ben Hutchings <ben at decadent.org.uk> wrote:
>
> On Sat, 2020-07-25 at 17:47 +0100, Ben Hutchings wrote:
> > On Sun, 2020-03-29 at 04:38 -0700, Bill Wendling wrote:
> > > - Renamed IMAGE_BASE to LD_IMAGE_BASE_OPT.
> > > - Moved "-fcommon" to KLIBCREQFLAGS in scripts/Kbuild.klibc.
> > > - Remove "dash" warning fixes which have been upstreamed.
> > > - Conditionalize the inclusion of compiler flags by using the proper
> > > compiler name or "cc-op...
2020 Aug 29
0
[klibc:riscv64-enable-relax] riscv64: Make linker relaxation work and enable it
...ccordingly.
#
-# We should get klibc.so and the executables to agree on what gp
-# should be. For now, disable gp-relative addressing.
-KLIBCLDFLAGS = --no-relax
KLIBCOPTFLAGS += -Os -fomit-frame-pointer
ifeq ($(DEBUG),y)
KLIBCOPTFLAGS += -g
@@ -21,3 +18,6 @@ KLIBCSHAREDFLAGS = $(LD_IMAGE_BASE_OPT) 0x00200000
# Kernel has never used stack trampolines
KLIBCEXECSTACK := n
+
+KLIBCEMAIN := -e _main
+KLIBCCRTSHARED += $(KLIBCOBJ)/arch/riscv64/_main.o
diff --git a/usr/klibc/arch/riscv64/_main.S b/usr/klibc/arch/riscv64/_main.S
new file mode 100644
index 00000000..284a2222
--- /dev/n...
2020 Aug 29
0
[klibc:riscv64-enable-relax] riscv64: Make linker relaxation work and enable it
...d be. For now, disable gp-relative addressing.
-KLIBCLDFLAGS = --no-relax
KLIBCOPTFLAGS += -Os -fomit-frame-pointer
ifeq ($(DEBUG),y)
KLIBCOPTFLAGS += -g
@@ -18,6 +15,10 @@ KLIBCBITSIZE = 64
# Normal binaries start at 64 KB, so start the libary at 2 MB.
KLIBCSHAREDFLAGS = $(LD_IMAGE_BASE_OPT) 0x00200000
+KLIBCSHAREDFLAGS += --defsym '__global_pointer$$=0'
# Kernel has never used stack trampolines
KLIBCEXECSTACK := n
+
+KLIBCEMAIN := -e _main
+KLIBCCRTSHARED += $(KLIBCOBJ)/arch/riscv64/_main.o
diff --git a/usr/klibc/arch/riscv64/_main.S b/usr/klibc/arch/riscv64/_m...
2020 Mar 27
1
[PATCH v2 2/5] Kbuild: support clang's lld
From: Stanislav Fomichev <sdf at google.com>
Clang's lld prefers the use of "-image-base" instead of
"-Ttext-segment".
Signed-off-by: Stanislav Fomichev <sdf at google.com>
Signed-off-by: Bill Wendling <morbo at google.com>
---
Makefile | 3 +++
usr/klibc/arch/i386/MCONFIG | 2 +-
usr/klibc/arch/mips64/MCONFIG | 2 +-
2023 Feb 20
1
[PATCH] Add LoongArch64 port
...rchitecture
+# 4862 MB - normal binaries start at 4608 MB. Non-PIC jumps usually
+# use the BL instruction which requires a destination between -128M
+# to 128M. Since we can't put ourselves below the normal load
+# address, use the very top of the 128M region (minus 2MB)
+KLIBCSHAREDFLAGS = $(LD_IMAGE_BASE_OPT) 0x127E00000
+
+# Kernel has never used stack trampolines
+KLIBCEXECSTACK := n
diff --git a/usr/klibc/arch/loongarch64/crt0.S b/usr/klibc/arch/loongarch64/crt0.S
new file mode 100644
index 00000000..cb3da669
--- /dev/null
+++ b/usr/klibc/arch/loongarch64/crt0.S
@@ -0,0 +1,18 @@
+#
+# arch/loonga...
2020 Mar 27
12
[PATCH 0/5] Clang compatibility patches
This is a series of patches for clang compatibility:
- Using flags needed flags and removing unsupported flags.
- Adding support for clang's LLD linker.
- Removing a variety of warnings.
Bill Wendling (3):
[klibc] Kbuild: use "libc.a" with clang
[klibc] Kbuild: Add "-fcommon" for clang builds
[klibc] Clean up clang warnings
Michael Davidson (1):
[klibc] Kbuild: