Hello community, here is the log from the commit of package mame for openSUSE:Factory checked in at 2018-01-26 13:40:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mame (Old) and /work/SRC/openSUSE:Factory/.mame.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mame" Fri Jan 26 13:40:16 2018 rev:6 rq:569744 version:0.193 Changes: -------- --- /work/SRC/openSUSE:Factory/mame/mame.changes 2018-01-06 18:56:11.539594143 +0100 +++ /work/SRC/openSUSE:Factory/.mame.new/mame.changes 2018-01-26 13:40:18.243040337 +0100 @@ -1,0 +2,18 @@ +Mon Jan 22 20:31:30 UTC 2018 - [email protected] + +- Several build fixes: + * Do no limit parallelism based on architecture, biggest memory + hog is final linking step, which is serial anyway + * Limit parallelism based on actual available memory, top is + about 1.4 GB per compiler job + * Limit debug level only on 32 bit archs (ix86, arm) + * Mangle %optflags instead of $RPM_OPT_FLAGS when reducing debug + level (-g1) for 32 bit archs, $RPM_OPT_FLAGS is unused + * Use gold instead of bfd linker, uses slightly less memory + * Delete static libraries between building mame-arcade and + mame-mess, these are no longer needed, by use disk space + * Set disk _constraints to 32 GB again, this is required by + -g2 builds on Leap 42.3/x86_64. + * Fix DOS line endings also for whatsnew*.txt + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mame.spec ++++++ --- /var/tmp/diff_new_pack.rj67kc/_old 2018-01-26 13:40:23.498794877 +0100 +++ /var/tmp/diff_new_pack.rj67kc/_new 2018-01-26 13:40:23.502794690 +0100 @@ -16,6 +16,24 @@ # +# Memory limit helper +%define smp_limit_kb_per_job() %( \ + kb_per_cpu=%1 \ + memtotal=$(sed "/MemTotal/ { s/MemTotal: \\+\\(.\\+\\) kB/\\1/ ; p } ; d" < /proc/meminfo) \ + jobs=$(( $memtotal / $kb_per_cpu )) \ + [ $jobs -lt 1 ] && jobs=1 \ + echo $jobs \ +) +# Limit to 1 job per 1400000 kByte (1.4 GByte) +%define _smp_ncpus_max %{smp_limit_kb_per_job 1400000} +# The build script hardcodes _smp_mflags to "-j_jobs", make it more useful +%define _smp_mflags %( \ + jobs=0%{?jobs}; \ + [ "$jobs" -lt 1 ] && jobs="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \ + ncpus_max=%{?_smp_ncpus_max}; \ + if [ "$jobs" -gt "$ncpus_max" ]; then jobs="$ncpus_max"; fi; \ + if [ "$jobs" -gt 1 ]; then echo "-j$jobs"; fi) + %define fver 193 # To build these, change to bcond_without %bcond_without mess @@ -35,6 +53,7 @@ Source101: mame.ini.in Source102: mame.appdata.xml Source104: mame-mess.appdata.xml +BuildRequires: binutils-gold BuildRequires: fdupes BuildRequires: pkgconfig BuildRequires: python-xml @@ -129,23 +148,32 @@ %prep %setup -q -n mame-mame0%fver +cp %{SOURCE1} whatsnew-%{version}.txt # Fix rpmlint warning "wrong-file-end-of-line-encoding" -sed -i 's/\r$//' LICENSE.md README.md +sed -i 's/\r$//' LICENSE.md README.md whatsnew-%{version}.txt # Set DATADIR and SYSCONFDIR in ini files sed -e "s,@DATADIR@,%{_datadir},g"\ -e "s,@SYSCONFDIR@,%{_sysconfdir},g" %{SOURCE101} > mame.ini -#ensure genie uses $RPM_OPT_FLAGS and $RPM_LD_FLAGS -sed -i "s@-Wall -Wextra -Os@%{optflags}@" 3rdparty/genie/build/gmake.linux/genie.make -sed -i "s@\. -s@\. %{optflags}@" 3rdparty/genie/build/gmake.linux/genie.make +# limit 32bit archs to debug level 1, the linker exhausts the address space otherwise +%ifarch %ix86 %arm +%define myoptflags %(echo %{optflags} | sed -E 's@(-g\\\b)|(-g[0-9])@-g1@g') +%else +%define myoptflags %{optflags} +%endif -%build -#standard -g causes builder to run out of memory -RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed "s@-g@-g1@") +#ensure genie uses %optflags +sed -i "s@-Wall -Wextra -Os@%{myoptflags}@" 3rdparty/genie/build/gmake.linux/genie.make +sed -i "s@\. -s@\. %{myoptflags}@" 3rdparty/genie/build/gmake.linux/genie.make -# Limit RAM usage during link -export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +%build +# Memory mapped files occupy the limited 32bit address space +%ifarch %ix86 %arm +export LDFLAGS="${LDFLAGS} -Wl,-v -fuse-ld=gold -Wl,--no-keep-files-mapped -Wl,--no-map-whole-files -Wl,--no-mmap-output-file" +%else +export LDFLAGS="${LDFLAGS} -Wl,-v -fuse-ld=gold" +%endif %if 0%{?suse_version} > 1320 export CFLAGS=$(pkg-config --cflags lua) @@ -153,6 +181,7 @@ COMMON_FLAGS="\ NOWERROR=1 \ + VERBOSE=1 \ OPTIMIZE=3 \ %if 0%{?suse_version} <= 1315 OVERRIDE_CC=gcc-5 \ @@ -173,19 +202,14 @@ USE_SYSTEM_LIB_UTF8PROC=1 \ %endif " -# limit x86 to a single CPU thread due to memory constraints -%ifarch %ix86 -make -j1 OPT_FLAGS="%{optflags}" $COMMON_FLAGS SUBTARGET=arcade TOOLS=1 -%else -make %{?_smp_mflags} OPT_FLAGS="%{optflags}" $COMMON_FLAGS SUBTARGET=arcade TOOLS=1 -%endif +make %{?_smp_mflags} OPT_FLAGS="%{myoptflags}" $COMMON_FLAGS SUBTARGET=arcade TOOLS=1 +# Remove static libraries after linking, to save some disk space +find build/ -ipath '*mame_arcade/lib*a' -delete %if %{with mess} -%ifarch %ix86 -make -j1 OPT_FLAGS="%{optflags}" $COMMON_FLAGS SUBTARGET=mess -%else -make %{?_smp_mflags} OPT_FLAGS="%{optflags}" $COMMON_FLAGS SUBTARGET=mess -%endif +make %{?_smp_mflags} OPT_FLAGS="%{myoptflags}" $COMMON_FLAGS SUBTARGET=mess +# Remove static libraries after linking, to save some disk space +find build/ -ipath '*mame_mess/lib*a' -delete %endif %install @@ -219,7 +243,6 @@ ldresample.1 ldverify.1 romcmp.1 %{buildroot}%{_mandir}/man1/ install -pm 0644 mame.6 mess.6 %{buildroot}%{_mandir}/man6/ popd -install -Dpm 0644 %{SOURCE1} docs/whatsnew-%{version}.txt # Install data required by mame for dir in artwork chds bgfx cheats crosshair ctrlr fonts hash \ @@ -273,9 +296,8 @@ %files %defattr(-,root,root,-) -%doc LICENSE.md README.md +%doc LICENSE.md README.md whatsnew-%{version}.txt %doc docs/LICENSE -%doc docs/whatsnew-%{version}.txt %{_bindir}/mame %{_datadir}/pixmaps/mame.png %{_datadir}/applications/mame.desktop @@ -327,9 +349,8 @@ %if %{with mess} %files mess -%doc LICENSE.md README.md +%doc LICENSE.md README.md whatsnew-%{version}.txt %doc docs/LICENSE -%doc docs/whatsnew-%{version}.txt %defattr(-,root,root) %{_bindir}/mame-mess %{_datadir}/pixmaps/mame-mess.png ++++++ _constraints ++++++ --- /var/tmp/diff_new_pack.rj67kc/_old 2018-01-26 13:40:23.570791514 +0100 +++ /var/tmp/diff_new_pack.rj67kc/_new 2018-01-26 13:40:23.574791328 +0100 @@ -2,7 +2,7 @@ <hardware> <processors>4</processors> <disk> - <size unit="G">20</size> + <size unit="G">32</size> </disk> <physicalmemory> <size unit="G">8</size>
