Skip to content

Commit

Permalink
games-util/wit: Fix -fno-common
Browse files Browse the repository at this point in the history
Bug: https://bugs.gentoo.org/742404
Closes: https://bugs.gentoo.org/706610
Closes: https://bugs.gentoo.org/724706
Closes: https://bugs.gentoo.org/739408
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: David Seifert <[email protected]>
  • Loading branch information
SoapGentoo committed Oct 3, 2020
1 parent 41858f0 commit 48a5b26
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 20 deletions.
11 changes: 11 additions & 0 deletions games-util/wit/files/wit-3.02a-fno-common.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/dclib/dclib-color.h
+++ b/dclib/dclib-color.h
@@ -535,7 +535,7 @@
/////////////// color helpers ///////////////
///////////////////////////////////////////////////////////////////////////////

-u32 ColorTab_M0_M15[16]; // first 16 colors of "\e[m"
+extern u32 ColorTab_M0_M15[16]; // first 16 colors of "\e[m"

// return a m256 index
u8 ConvertColorRGB3ToM256 ( u8 r, u8 g, u8 b );
113 changes: 102 additions & 11 deletions games-util/wit/files/wit-3.02a-makefile.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
Don't link libdl into wfuse as it's unnecessary, use system bzip2, respect user
CFLAGS, use pkgconfig to determine ncurses libs, and use verbose build output.

--- wiimms-iso-tools.source-3.02a/Makefile
+++ wiimms-iso-tools.source-3.02a/Makefile
@@ -171,7 +171,7 @@
--- a/Makefile
+++ b/Makefile
@@ -111,11 +111,6 @@
#-------------------------------------------------------------------------------
# compiler settings

-PRE ?=
-CC = $(PRE)gcc
-CPP = $(PRE)g++
-STRIP = $(PRE)strip
-
#-------------------------------------------------------------------------------
# files

@@ -171,7 +166,7 @@
TOPT_wit := $(OPT_STATIC)
TOPT_wwt := $(OPT_STATIC)
TOPT_wdf := $(OPT_STATIC)
Expand All @@ -12,7 +24,7 @@ CFLAGS, use pkgconfig to determine ncurses libs, and use verbose build output.

#TOPT_ALL := $(TOPT_wit) $(TOPT_wwt) $(TOPT_wdf) $(TOPT_wfuse)

@@ -206,8 +206,8 @@
@@ -206,8 +201,8 @@
endif

# lib summary
Expand All @@ -23,28 +35,35 @@ CFLAGS, use pkgconfig to determine ncurses libs, and use verbose build output.
RM_FILES += $(foreach l,$(LIB_LIST),src/$(l)/*.{d,o})


@@ -297,10 +297,8 @@
@@ -297,10 +292,9 @@
DEFINES1 += -D_LZMA_PROB32=1 # LZMA option
DEFINES = $(strip $(DEFINES1) $(MODE) $(XDEF))

-CFLAGS += -fomit-frame-pointer -fno-strict-aliasing -funroll-loops
+CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall -Wno-parentheses -Wno-unused-function
-#CFLAGS += -O3 -Isrc/libwbfs -Isrc/lzma -Isrc -I$(UI) -I. -Iwork
-CFLAGS += -O3 -Isrc/libwbfs -Isrc -I$(UI) -I. -Iwork
+CFLAGS += -Isrc/libwbfs -Isrc -I$(UI) -I. -Iwork
ifeq ($(SYSTEM),cygwin)
CFLAGS += -Wno-format-truncation
else ifeq ($(SYSTEM),mac)
@@ -317,7 +315,7 @@
@@ -311,13 +305,10 @@

DEPFLAGS += -MMD

-LDFLAGS += -static-libgcc
-LDFLAGS := $(strip $(LDFLAGS))
-
ifeq ($(HAVE_ZLIB),1)
LIBS += -lz
endif
-LIBS += -lm -lncurses $(XLIBS)
+LIBS += -lm $(shell pkg-config --libs ncurses) -lbz2 $(XLIBS)
+LIBS += -lm $(shell $(PKG_CONFIG) --libs ncurses) -lbz2 $(XLIBS)

DISTRIB_RM = ./wit-v$(VERSION)-r
DISTRIB_BASE = wit-v$(VERSION)-r$(REVISION_NEXT)
@@ -370,83 +368,70 @@
@@ -370,83 +361,70 @@
# general rules

$(ALL_TOOLS_X): %: %.o $(ALL_OBJECTS) $(TOBJ_ALL) Makefile | $(HELPER_TOOLS)
Expand Down Expand Up @@ -144,7 +163,7 @@ CFLAGS, use pkgconfig to determine ncurses libs, and use verbose build output.

#
###############################################################################
@@ -644,9 +629,8 @@
@@ -644,9 +622,8 @@

.PHONY : gen-doc
gen-doc:
Expand All @@ -156,7 +175,16 @@ CFLAGS, use pkgconfig to determine ncurses libs, and use verbose build output.

#
#--------------------------
@@ -764,8 +748,7 @@
@@ -750,7 +727,7 @@

.PHONY : predef
predef:
- @gcc -E -dM none.c | sort
+ @$(CC) -E -dM none.c | sort

#
#--------------------------
@@ -764,8 +741,7 @@
#--------------------------

templates.sed: Makefile
Expand All @@ -166,7 +194,7 @@ CFLAGS, use pkgconfig to determine ncurses libs, and use verbose build output.
'/^~/ d;\n' \
's|@.@@@|$(VERSION_NUM)|g;\n' \
's|@@@@-@@-@@|$(DATE)|g;\n' \
@@ -828,13 +811,12 @@
@@ -828,13 +804,12 @@

.PHONY : test
test:
Expand All @@ -185,3 +213,66 @@ CFLAGS, use pkgconfig to determine ncurses libs, and use verbose build output.

#
#--------------------------
--- a/makefiles-local/Makefile.local.i386
+++ b/makefiles-local/Makefile.local.i386
@@ -5,6 +5,3 @@
# => copy Makefile.local to main directory and remove appropriate comments

#------------------------------------------------------------------------------
-
-#CFLAGS += -mtune=generic
-CFLAGS += -march=i686
--- a/makefiles-local/Makefile.local.x86_64
+++ b/makefiles-local/Makefile.local.x86_64
@@ -5,6 +5,3 @@
# => copy Makefile.local to main directory and remove appropriate comments

#------------------------------------------------------------------------------
-
-CFLAGS += -march=x86-64
-
--- a/setup.sh
+++ b/setup.sh
@@ -118,6 +118,6 @@

---EOT---

-gcc $xflags system.c -o system.tmp && ./system.tmp >>Makefile.setup
+${CC} $xflags system.c -o system.tmp && ./system.tmp >>Makefile.setup
rm -f system.tmp

--- a/test-libwbfs/Makefile
+++ b/test-libwbfs/Makefile
@@ -7,11 +7,6 @@

SHELL = /bin/bash

-PRE ?=
-CC = $(PRE)gcc
-CPP = $(PRE)g++
-STRIP = $(PRE)strip
-
#-------------------------------------------------------------------------------
# files

@@ -46,18 +41,14 @@
DEFINES = -DLARGE_FILES -D_FILE_OFFSET_BITS=64 $(XDEF)
DEFINES := $(strip $(DEFINES))

-CFLAGS = -fomit-frame-pointer -fno-strict-aliasing
+CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall -Wno-parentheses -Wno-unused-function
-CFLAGS += -O3 -I../src/libwbfs -I.
+CFLAGS += -I../src/libwbfs -I.
CFLAGS += $(XFLAGS)
CFLAGS := $(strip $(CFLAGS))

DEPFLAGS += -MMD

-LDFLAGS += -static-libgcc
-#LDFLAGS += -static
-LDFLAGS := $(strip $(LDFLAGS))
-
LIBS += $(XLIBS)

#
25 changes: 16 additions & 9 deletions games-util/wit/wit-3.02a.ebuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2019 Gentoo Authors
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
Expand All @@ -19,24 +19,31 @@ IUSE="+fuse +zlib"
RDEPEND="
app-arch/bzip2:0=
fuse? ( sys-fs/fuse:0= )
zlib? ( sys-libs/zlib:0= )
"
zlib? ( sys-libs/zlib:0= )"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"

DOCS="doc/*.txt"
S="${WORKDIR}/${MY_P}"

PATCHES=(
"${FILESDIR}"/${P}-makefile.patch
"${FILESDIR}"/${PN}-2.30a-no-exec-stack.patch
"${FILESDIR}"/${P}-no-exec-stack.patch
"${FILESDIR}"/${P}-fno-common.patch
)

S=${WORKDIR}/${MY_P}

src_compile() {
src_configure() {
export NO_FUSE=$(usex fuse 0 1)
export NO_ZLIB=$(usex zlib 0 1)

emake INSTALL_PATH="${D}"/usr CC="$(tc-getCC)"
tc-export CC PKG_CONFIG
}

src_compile() {
emake INSTALL_PATH="${ED}"/usr
emake doc
}

src_install() {
default
dodoc doc/*.txt
}

0 comments on commit 48a5b26

Please sign in to comment.