Skip to content

Commit

Permalink
uClibc++: Update to 0.2.5
Browse files Browse the repository at this point in the history
Switched to xz archives for smaller size.

Removed upstreamed patches.

Reorganized Makefile a little bit for clarity. Build/Prepare is not useful
anymore. Upstream converted the file to LF.

Refreshed config.

Removed -ansi option from the original CFLAGS as this was causing long
long support to be missing.

Removed fPIC. We have the macro $(FPIC) already used. No point in setting
fpic and fPIC together.

Removed pedantic -Wlong-long warnings as they are not useful.

Removed -std=gnu++98. Not only is it unnecessary (it compiles against all
standards), it actually results in a size increase. 75843 vs. 75222 (gcc
in OpenWrt defaults to g++14).

Added --gc-sections to linker flags to reduce size: 72653 vs 75222.

Removed warn linker options. They have been upstreamed.

Tested on Archer C7v2 and GnuBee PC1.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
  • Loading branch information
neheb authored and hauke committed May 11, 2019
1 parent e49b6bb commit 0b26382
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 291 deletions.
28 changes: 10 additions & 18 deletions package/libs/uclibc++/Makefile
Expand Up @@ -9,12 +9,12 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=uclibc++
PKG_VERSION:=0.2.4
PKG_RELEASE:=3
PKG_VERSION:=0.2.5
PKG_RELEASE:=1

PKG_SOURCE:=uClibc++-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://cxx.uclibc.org/src/
PKG_HASH:=be16fc6a6eb2e59df420ee41e7042f38e27ebaf5c2762d90e75803364a7b00db
PKG_SOURCE:=uClibc++-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://cxx.uclibc.org/src/
PKG_HASH:=596fb9ed7295564ce4c70ae6076a18f92e72f70310d70c98520bbca85c77895a

PKG_BUILD_DIR:=$(BUILD_DIR)/uClibc++-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
Expand All @@ -30,7 +30,7 @@ define Package/uclibcxx
SECTION:=libs
CATEGORY:=Libraries
TITLE:=C++ library for embedded systems
URL:=http://cxx.uclibc.org/src/
URL:=https://cxx.uclibc.org/
endef

UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
Expand All @@ -45,7 +45,8 @@ UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
-e 's/mipsel.*/mips/' \
)

TARGET_CFLAGS += $(FPIC)
TARGET_CFLAGS += $(FPIC) -nostdinc++
TARGET_LDFLAGS += -Wl,--gc-sections

ifneq ($(CONFIG_CCACHE),)
TARGET_CXX=$(TARGET_CXX_NOCACHE)
Expand All @@ -56,24 +57,15 @@ SSP_LIB=-lssp_nonshared
endif

MAKE_FLAGS:= \
TOPDIR="$(PKG_BUILD_DIR)/" \
$(TARGET_CONFIGURE_OPTS) \
CPU_CFLAGS="$(TARGET_CFLAGS)" \
CROSS="$(TARGET_CROSS)" \
LDFLAGS="-Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,defs $(TARGET_LDFLAGS)" \
CP="$(CP)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
GEN_LIBS="-lc $(LIBGCC_S) $(SSP_LIB)" \
GEN_CFLAGS="-std=gnu++98 -nostdinc++" \
check_as_needed=

# check_as_needed overrides dependency on libgcc_s

define Build/Prepare
$(PKG_UNPACK)
$(SED) 's/\r$$$$//' $(PKG_BUILD_DIR)/include/unwind-cxx.h
$(Build/Patch)
endef

define Build/Configure
if [ -f ./files/config.$(UCLIBC_TARGET_ARCH) ]; then \
cp ./files/config.$(UCLIBC_TARGET_ARCH) $(PKG_BUILD_DIR)/.config; \
Expand Down
10 changes: 5 additions & 5 deletions package/libs/uclibc++/files/config.default
Expand Up @@ -8,7 +8,7 @@
UCLIBCXX_HAS_FLOATS=y
# UCLIBCXX_HAS_LONG_DOUBLE is not set
# UCLIBCXX_HAS_TLS is not set
WARNINGS="-Wall"
UCLIBCXX_WARNINGS=""
BUILD_EXTRA_LIBRARIES=""
HAVE_DOT_CONFIG=y

Expand All @@ -23,10 +23,10 @@ UCLIBCXX_SUPPORT_CIN=y
UCLIBCXX_SUPPORT_COUT=y
UCLIBCXX_SUPPORT_CERR=y
UCLIBCXX_SUPPORT_CLOG=y
UCLIBCXX_SUPPORT_WCIN=y
UCLIBCXX_SUPPORT_WCOUT=y
UCLIBCXX_SUPPORT_WCERR=y
UCLIBCXX_SUPPORT_WCLOG=y
# UCLIBCXX_SUPPORT_WCIN is not set
# UCLIBCXX_SUPPORT_WCOUT is not set
# UCLIBCXX_SUPPORT_WCERR is not set
# UCLIBCXX_SUPPORT_WCLOG is not set

#
# STL and Code Expansion
Expand Down
10 changes: 10 additions & 0 deletions package/libs/uclibc++/patches/001-no-ansi.patch
@@ -0,0 +1,10 @@
--- a/Rules.mak
+++ b/Rules.mak
@@ -232,7 +232,6 @@ endif
GEN_CXXFLAGS:=-nostdinc++
GEN_CXXFLAGS+=$(if $(CXXFLAG_-fvisibility-inlines-hidden),-DGCC_HASCLASSVISIBILITY)
CXXFLAGS:=$(CFLAGS)
-CFLAGS += -ansi

LIBGCC:=$(shell $(CC) -print-libgcc-file-name)
LIBGCC_DIR:=$(dir $(LIBGCC))
11 changes: 0 additions & 11 deletions package/libs/uclibc++/patches/002-path_to_bash.patch

This file was deleted.

13 changes: 13 additions & 0 deletions package/libs/uclibc++/patches/002-quote-fix.patch
@@ -0,0 +1,13 @@
--- a/bin/Makefile.in
+++ b/bin/Makefile.in
@@ -44,8 +44,8 @@ define do_wrapper
$(Q)echo ' WRAPPER_OPTIONS="$$WRAPPER_OPTIONS -nodefaultlibs $$WRAPPER_LIBDIR -l$(LNAME) $$WRAPPER_LIBS"' >> $@.tmp
$(Q)echo 'fi' >> $@.tmp
$(Q)echo '' >> $@.tmp
- $(Q)echo '[ -n "$$V" ] && [ $$V -gt 1 ] && echo $(CXX) $(GEN_CFLAGS) $(GEN_CXXFLAGS) $(EH_CXXFLAGS) $$WRAPPER_INCLUDEDIR "$$@" $$WRAPPER_OPTIONS' >> $@.tmp
- $(Q)echo 'exec $(CXX) $(GEN_CFLAGS) $(GEN_CXXFLAGS) $(EH_CXXFLAGS) $$WRAPPER_INCLUDEDIR "$$@" $$WRAPPER_OPTIONS' >> $@.tmp
+ $(Q)echo '[ -n "$$V" ] && [ $$V -gt 1 ] && echo $(CXX) $(GEN_CFLAGS) $(GEN_CXXFLAGS) $(EH_CXXFLAGS) $$WRAPPER_INCLUDEDIR $$@ $$WRAPPER_OPTIONS' >> $@.tmp
+ $(Q)echo 'exec $(CXX) $(GEN_CFLAGS) $(GEN_CXXFLAGS) $(EH_CXXFLAGS) $$WRAPPER_INCLUDEDIR $$@ $$WRAPPER_OPTIONS' >> $@.tmp
$(Q)echo '' >> $@.tmp
$(Q)chmod 0755 $@.tmp
$(Q)mv $@.tmp $@
10 changes: 10 additions & 0 deletions package/libs/uclibc++/patches/003-no-fPIC.patch
@@ -0,0 +1,10 @@
--- a/Rules.mak
+++ b/Rules.mak
@@ -185,7 +185,6 @@ export UCLIBCXX_RUNTIME_PREFIX UCLIBCXX_RUNTIME_LIBDIR UCLIBCXX_RUNTIME_BINDIR U

WRAPPER = $(top_builddir)bin/g++-uc
OPTIMIZATION:=
-PICFLAG:=-fPIC

# use '-Os' optimization if available, else use -O2, allow Config to override
$(eval $(call check-gcc-var,-Os))
13 changes: 13 additions & 0 deletions package/libs/uclibc++/patches/004-no-pedantic.patch
@@ -0,0 +1,13 @@
--- a/Rules.mak
+++ b/Rules.mak
@@ -200,10 +200,6 @@ $(eval $(call check-gxx-var,-std=gnu++14))
$(eval $(call check-gxx-var,-Wno-sized-deallocation))
$(eval $(call check-gxx-var,-Wno-tautological-compare))

-# Add a bunch of extra pedantic annoyingly strict checks
-XWARNINGS=$(call qstrip,$(UCLIBCXX_WARNINGS)) -Wno-trigraphs -pedantic
-CPU_CFLAGS=$(call qstrip,$(CPU_CFLAGS-y))
-
# Some nice CFLAGS to work with
GEN_CFLAGS:=-fno-builtin
CFLAGS:=$(XWARNINGS) $(CPU_CFLAGS)
38 changes: 0 additions & 38 deletions package/libs/uclibc++/patches/006-eabi_fix.patch

This file was deleted.

23 changes: 0 additions & 23 deletions package/libs/uclibc++/patches/010-honor-ldflags.patch

This file was deleted.

22 changes: 0 additions & 22 deletions package/libs/uclibc++/patches/020-template-fix.patch

This file was deleted.

114 changes: 0 additions & 114 deletions package/libs/uclibc++/patches/030-memory_corruption_fix.patch

This file was deleted.

20 changes: 0 additions & 20 deletions package/libs/uclibc++/patches/040-delete-c++14.patch

This file was deleted.

0 comments on commit 0b26382

Please sign in to comment.