summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldso/ldso/Makefile9
-rw-r--r--ldso/libdl/Makefile9
2 files changed, 18 insertions, 0 deletions
diff --git a/ldso/ldso/Makefile b/ldso/ldso/Makefile
index e7a011495..b8f0e030e 100644
--- a/ldso/ldso/Makefile
+++ b/ldso/ldso/Makefile
@@ -32,6 +32,15 @@ XXFLAGS=$(XWARNINGS) $(OPTIMIZATION) $(XARCH_CFLAGS) $(CPU_CFLAGS) $(PICFLAG) \
-DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
-DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR) && pwd)\" \
-fno-builtin -nostdinc -I$(TOPDIR)ldso/include -I. -I$(TOPDIR)include
+
+ifeq ($(DODEBUG),y)
+XXFLAGS=$(XWARNINGS) -O0 -g3 $(XARCH_CFLAGS) $(CPU_CFLAGS) $(PICFLAG) \
+ -DUCLIBC_TARGET_PREFIX=\"$(TARGET_PREFIX)\" \
+ -DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
+ -DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR) && pwd)\" \
+ -fno-builtin -nostdinc -I$(TOPDIR)ldso/include -I. -I$(TOPDIR)include
+endif
+
XXFLAGS+=$(shell $(CC) -print-search-dirs | sed -ne "s/install: *\(.*\)/-I\1include/gp")
LDFLAGS=$(CPU_LDFLAGS-y) -shared --warn-common --export-dynamic --sort-common \
-z combreloc --discard-locals --discard-all
diff --git a/ldso/libdl/Makefile b/ldso/libdl/Makefile
index 12461d77e..00142a8f2 100644
--- a/ldso/libdl/Makefile
+++ b/ldso/libdl/Makefile
@@ -26,6 +26,15 @@ XXFLAGS=$(XWARNINGS) $(OPTIMIZATION) $(XARCH_CFLAGS) $(CPU_CFLAGS) \
-DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
-DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR) && pwd)\" \
-fno-builtin -nostdinc -D_LIBC -I$(TOPDIR)ldso/include -I. -I$(TOPDIR)include
+
+ifeq ($(DODEBUG),y)
+XXFLAGS=$(XWARNINGS) -O0 -g3 $(XARCH_CFLAGS) $(CPU_CFLAGS) \
+ -DUCLIBC_TARGET_PREFIX=\"$(TARGET_PREFIX)\" \
+ -DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
+ -DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR) && pwd)\" \
+ -fno-builtin -nostdinc -D_LIBC -I$(TOPDIR)ldso/include -I. -I$(TOPDIR)include
+endif
+
XXFLAGS+=$(shell $(CC) -print-search-dirs | sed -ne "s/install: *\(.*\)/-I\1include/gp")
XXFLAGS_NOPIC:=$(XXFLAGS)
ifeq ($(DOPIC),y)