Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
f0f500d35a
!19 [sync] PR-18: Add PIE flags
From: @openeuler-sync-bot 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2023-06-13 02:52:14 +00:00
wu-leilei
f69fa50445 Add PIE flags
(cherry picked from commit 216ed2bdc0a81add4d659b1bd85202640cc6626c)
2023-06-13 09:05:58 +08:00
openeuler-ci-bot
21bfb5a840
!16 [sync] PR-14: Add relro flag
From: @openeuler-sync-bot 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2022-12-08 07:40:04 +00:00
wang--ge
a77e313e39 add relro flag
(cherry picked from commit 2c6e6bfcc1bdce9480db9c2ba106b4193cf46ad9)
2022-12-08 15:29:25 +08:00
openeuler-ci-bot
76e2e7f382 !9 [sync] PR-8: Add BIND_NOW and PIE flags
From: @openeuler-sync-bot
Reviewed-by: @overweight
Signed-off-by: @overweight
2021-09-10 06:32:04 +00:00
lingsheng
2af242ee30 Add BIND_NOW and PIE flags
(cherry picked from commit e5a376391660a79d70d037e8cdaeae9032252a44)
2021-09-08 15:38:53 +08:00
openeuler-ci-bot
b374cf2763 !4 Remove unnecessary buildrequire gdb
From: @ultra_planet
Reviewed-by: @xiezhipeng1
Signed-off-by: @xiezhipeng1
2021-07-22 07:04:05 +00:00
lingsheng
7f9b07aed6 Remove unnecessary buildrequire gdb 2021-07-21 17:18:04 +08:00
openeuler-ci-bot
fa9c2e6f3a !1 package init
Merge pull request !1 from sherlock2010/master
2020-02-29 11:58:24 +08:00
sherlock2010
22b3edec72 package init 2020-02-29 11:47:15 +08:00
4 changed files with 120 additions and 0 deletions

BIN
dietlibc-0.34.tar.xz Normal file

Binary file not shown.

BIN
dietlibc-0.34.tar.xz.sig Normal file

Binary file not shown.

View File

@ -0,0 +1,11 @@
--- a/include/paths.h~ 2008-02-22 18:09:54.000000000 -0600
+++ b/include/paths.h 2016-07-25 12:03:25.144058895 -0500
@@ -2,7 +2,7 @@
#define _PATHS_H
#define _PATH_BSHELL "/bin/sh"
-#define _PATH_DEFPATH "/bin:/usr/bin:"
+#define _PATH_DEFPATH "/bin:/usr/bin"
#define _PATH_DEVNULL "/dev/null"

109
dietlibc.spec Normal file
View File

@ -0,0 +1,109 @@
%global fixcflags -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables %xtra_fixcflags -Os -g3 -Werror-implicit-function-declaration -Wno-unused -Wno-switch -fPIE -Wl,-pie -Wl,-z,relro,-z,now
%global basemakeflags prefix=%pkglibdir BINDIR=%{_bindir} MAN1DIR=%{_mandir}/man1 CFLAGS="$RPM_OPT_FLAGS %fixcflags $XTRA_CFLAGS" PDIET=%pkglibdir STRIP=:
%global pkglibdir /usr/lib/dietlibc
%ifarch x86_64
%bcond_without ssp
%else
%bcond_with ssp
%endif
Name: dietlibc
Version: 0.34
Release: 6
Summary: A libc optimized for small size
License: GPLv2
URL: http://www.fefe.de/dietlibc/
Source0: https://www.fefe.de/dietlibc/%{name}-%{version}.tar.xz
Source1: http://www.fefe.de/dietlibc/%{name}-%{version}.tar.xz.sig
Patch0001: dietlibc-insecure-defpath.patch
Obsoletes: dietlibc-lib < %{version}-%{release}
BuildRequires: gcc
Requires: %{name}-devel = %{version}-%{release}
%description
The diet libc is a libc that is optimized for small size. It can be used to create small statically
linked binaries for Linux on alpha, arm, hppa, ia64, i386, mips, s390, sparc, sparc64, ppc and x86_64.
%package devel
Summary: Development documents for %{name}
Requires: %{name} = %{version}-%{release}
Obsoletes: %{name}-header < %{version}-%{release}
Provides: %{name}-header = %{version}-%{release}
Provides: %{name}-static = %{version}-%{release} %{name}-static%{?_isa} = %{version}-%{release}
%description devel
The package provides libraries and some other development documents for developing applications
that use %{name}.
%package help
Summary: Help documents for %{name}
%description help
The package provides man pages and some other help information for %{name}.
%prep
%autosetup -p1 -n %{name}-%{version}
%if %{without ssp}
sed -i -e 's!^#define WANT_SSP$!// \0!g;
s!.*\(#define WANT_STACKGAP\).*!\1!g' dietfeatures.h
%global xtra_fixcflags -fno-stack-protector
%else
%global xtra_fixcflags %nil
%endif
sed -i -e '/#define \(WANT_LARGEFILE_BACKCOMPAT\)/d' dietfeatures.h
sed -i -e '/#define \(WANT_VALGRIND_SUPPORT\)/d' dietfeatures.h
%build
%make_build %basemakeflags all
%install
install -d -m755 $RPM_BUILD_ROOT/etc
%make_install %basemakeflags
ln -s lib-%{_arch} ${RPM_BUILD_ROOT}%pkglibdir/lib-%{_arch}-%{_vendor}
chmod a-x $RPM_BUILD_ROOT%pkglibdir/lib-*/*.o
%check
XTRA_CFLAGS='-fno-builtin'
%make_build %basemakeflags -C test all DIET=$(echo `pwd`/bin-*/diet) -k || :
%make_build %basemakeflags -C test/inet all DIET=$(echo `pwd`/bin-*/diet) || :
cd test
ulimit -m $[ 128*1024 ] -v $[ 256*1024 ] -d $[ 128*1024 ] -s 512
%files
%doc AUTHOR COPYING
%{_bindir}/*
%exclude %{_bindir}/dnsd
%files devel
%pkglibdir
%files help
%doc BUGS CAVEAT CHANGES FAQ PORTING README* SECURITY THANKS TODO
%doc %{_mandir}/*/*
%changelog
* Mon Jun 05 2023 wu lei <wu_lei@hoperun.com> - 0.34-6
- Add PIE flags
* Sat Dec 03 2022 Ge Wang <wangge20@h-partners.com> - 0.34-5
- Add RELRO flags
* Tue Sep 07 2021 lingsheng <lingsheng@huawei.com> - 0.34-4
- Add BIND_NOW and PIE flags
* Wed Jul 21 2021 lingsheng <lingsheng@huawei.com> - 0.34-3
- Remove unnecessary buildrequire gdb
* Thu Feb 27 2020 zhouyihang<zhouyihang1@huawei.com> - 0.34-2
- Package init