First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 109949
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo for Mac OS X <ppc-macos@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Dirk Schoenberger <dirk.schoenberger@freenet.de>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
DLL.patch explicit cast to wanted pointer patch Dirk Schoenberger 2005-10-25 11:52 0000 668 bytes Details | Diff
ebuild-macosx.patch create a MacOSX friendly build environment patch Dirk Schoenberger 2005-10-27 15:43 0000 406 bytes Details | Diff
p7zip.diff patch for the 42 ebuild patch Fabian Groffen 2006-08-27 11:19 0000 585 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 109949 depends on: Show dependency tree
Bug 109949 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-10-20 13:44 0000
While trying to emerge p7zip-4.27 I ran into the following problem

g++ -O2 -pipe -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DNDEBUG -D_REENTRANT -
DENV_UNIX  -c -I../../../myWindows -I../../../ -I../../../include_windows ./OpenCallbackConsole.cpp
g++ -O2 -pipe -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DNDEBUG -D_REENTRANT -
DENV_UNIX  -c -I../../../myWindows -I../../../ -I../../../include_windows ./PercentPrinter.cpp
g++ -O2 -pipe -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DNDEBUG -D_REENTRANT -
DENV_UNIX  -c -I../../../myWindows -I../../../ -I../../../include_windows ./UpdateCallbackConsole.cpp
g++ -O2 -pipe -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DNDEBUG -D_REENTRANT -
DENV_UNIX  -c -I../../../myWindows -I../../../ -I../../../include_windows ./UserInputUtils.cpp
g++ -O2 -pipe -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DNDEBUG -D_REENTRANT -
DENV_UNIX  -c -I../../../myWindows -I../../../ -I../../../include_windows ../../../Windows/DLL.cpp
../../../Windows/DLL.cpp: In member function 'bool NWindows::NDLL::CLibrary::Free()':
../../../Windows/DLL.cpp:41: error: invalid conversion from 'void*' to '__NSModule*'
../../../Windows/DLL.cpp:41: error:   initializing argument 1 of 'bool NSUnLinkModule(__NSModule*, 
uint32_t)'
../../../Windows/DLL.cpp: In function 'int (* NWindows::NDLL::local_GetProcAddress(void*, const 
CHAR*))()':
../../../Windows/DLL.cpp:63: error: invalid conversion from 'void*' to '__NSModule*'
../../../Windows/DLL.cpp:63: error:   initializing argument 1 of '__NSSymbol* NSLookupSymbolInModule
(__NSModule*, const char*)'
make[1]: *** [DLL.o] Error 1
make: *** [7z] Error 2
make: *** Waiting for unfinished jobs....


Reproducible: Always
Steps to Reproduce:
1.
2.
3.




Portage 2.0.51.22-r3 (default-darwin/macos/10.4, gcc-4.0.0, libsystem-7.1-r0, 8.2.0 Power 
Macintosh)
===============================================================
==
System uname: 8.2.0 Power Macintosh powerpc
macos-20041118
distcc 2.0.1-zeroconf powerpc-apple-darwin7.0 (protocol 1) (default port 3632) [disabled]
dev-lang/python:     [Not Present]
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  [Not Present]
sys-devel/automake:  [Not Present]
sys-devel/binutils:  [Not Present]
sys-devel/libtool:   [Not Present]
virtual/os-headers:  7.1
ACCEPT_KEYWORDS="ppc-macos"
AUTOCLEAN="yes"
CBUILD="powerpc-apple-darwin8"
CFLAGS="-O2 -pipe"
CHOST="powerpc-apple-darwin8"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/
qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig collision-protect distlocks sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/
gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="ppc aalib emboss gdbm gif imagemagick libwww nls ogg opengl png ppc-macos qt sdl slang tiff 
vorbis userland_Darwin kernel_Darwin elibc_Darwin"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY

------- Comment #1 From Canal Vorfeed 2005-10-24 17:02:48 0000 -------
Note: this is known problem (see bug #104248) but noone who care about p7zip
have access to MacOS X so you are on your own there.

------- Comment #2 From Dirk Schoenberger 2005-10-25 11:51:51 0000 -------
After searching a little the problem seems to be that MacOSXs gcc doesn't line
to implicitly cast between a 
void* and a typed pointer.
The solution could be an explicit cast (as in the attached pacth against
Windows/DLL.cc)
This is not tested.

------- Comment #3 From Dirk Schoenberger 2005-10-25 11:52:32 0000 -------
Created an attachment (id=71440) [edit]
explicit cast to wanted pointer

------- Comment #4 From Fabian Groffen 2005-10-26 02:46:34 0000 -------
hmmm, using your patch, I now get a normal error, Dirk:

powerpc-apple-darwin8-g++-4.0.0: unrecognized option '-shared'
/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status
make[1]: *** [../../../bin/Formats/7z.so] Error 1
make: *** [7z] Error 2


Did you perhaps patch something more?

------- Comment #5 From Dirk Schoenberger 2005-10-26 05:52:02 0000 -------
> hmmm, using your patch, I now get a normal error, Dirk:

> powerpc-apple-darwin8-g++-4.0.0: unrecognized option '-shared'

This means that the original problem (a compiler error about incompatibility
between a void* and __NSModule*) seems to be solved.
No there is only a linker error left.

Problem is I could not reproduce the compiler error without the ebuild, so my
patch was purely speculative (and seemingly not complete)

------- Comment #6 From Dirk Schoenberger 2005-10-27 15:42:59 0000 -------
> hmmm, using your patch, I now get a normal error, Dirk:

> powerpc-apple-darwin8-g++-4.0.0: unrecognized option '-shared'
> /usr/bin/ld: Undefined symbols:
> _main

From what I understood, you are supposed to use the correct makefile.* in the root folder, and copy or 
link the correct file to makefile.machine. This makefile.machine file is included by several sub-
makefiles.
The remaining problem is that the application compiles and links fine, but it links against 
hardcoded .so (instead of .dylib) files. 

I attach a changed ebuild file. This must possibly be made platform dependent, i.e. it needs additional 
checks.

------- Comment #7 From Dirk Schoenberger 2005-10-27 15:43:42 0000 -------
Created an attachment (id=71591) [edit]
create a MacOSX friendly build environment

------- Comment #8 From Fabian Groffen 2006-01-31 13:36:56 0000 -------
a gcc4.1 fix has been committed for p7zip-4.30.  It compiles till the linker
problem (
powerpc-apple-darwin8-g++-4.0.1: unrecognized option '-shared'
/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status
), which if I read correctly is a 'profile' issue.  I hope to be able to look
into this later to see if it is easy to 'switch' this profile from the ebuild
somehow.

------- Comment #9 From Radoslaw Stachowiak 2006-08-27 09:36:48 0000 -------
Could You please test newest version of p7zip and provide Your observations?

------- Comment #10 From Fabian Groffen 2006-08-27 10:28:53 0000 -------
g++ -O3 -pipe -s -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DNDEBUG
-D_REENTRANT -DENV_UNIX -DCOMPRESS_MT -shared -o ../../../bin/Formats/7z.so
-Wl,-search_paths_first ../../../Common/MyWindows.o ../../../Common/Alloc.o
../../../Common/Vector.o ../../../Common/StringConvert.o
../../../Common/String.o ../../../Common/CRC.o ../../../Common/IntToString.o
../../../Common/StringToInt.o DllExports.o 7zDecode.o 7zEncode.o 7zExtract.o
7zFolderInStream.o 7zFolderOutStream.o 7zHandler.o 7zHandlerOut.o 7zHeader.o
7zIn.o 7zMethodID.o 7zMethods.o 7zOut.o 7zProperties.o 7zSpecStream.o
7zUpdate.o CodecsPath.o CoderLoader.o CoderMixer2.o CoderMixer2MT.o
CrossThreadProgress.o FilterCoder.o InStreamWithCRC.o ItemNameUtils.o
MultiStream.o StreamUtils.o OutStreamWithCRC.o ParseProperties.o
InOutTempBuffer.o LimitedStreams.o LockedStream.o OutBuffer.o ProgressUtils.o
StreamBinder.o StreamObjects.o DLL.o FileDir.o FileFind.o FileIO.o
PropVariant.o Synchronization.o CopyCoder.o
../../../myWindows/wine_date_and_time.o ../../../myWindows/myModuleFileName.o
../../../myWindows/myGetNumberOfProcessors.o -lpthread -ldl
powerpc-apple-darwin8-g++-4.0.1: unrecognized option '-shared'
/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status
make[1]: *** [../../../bin/Formats/7z.so] Error 1
make: *** [7z] Error 2
make: *** Waiting for unfinished jobs....


Looks like the main program isn't linked in.  Haven't looked at it any closer.

------- Comment #11 From Radoslaw Stachowiak 2006-08-27 10:38:41 0000 -------
Was http://bugs.gentoo.org/show_bug.cgi?id=109949#c10 result of 4.42
compilation?

------- Comment #12 From Fabian Groffen 2006-08-27 10:40:42 0000 -------
yes, I ran it before reporting.

------- Comment #13 From Radoslaw Stachowiak 2006-08-27 10:45:29 0000 -------
I have no knowlegde of macos, but maybe 
"powerpc-apple-darwin8-g++-4.0.1: unrecognized option '-shared'" is a hint?
is there any documentation about -shared in mac g++ ?

------- Comment #14 From Fabian Groffen 2006-08-27 10:58:36 0000 -------
GCC on OSX can only do dynamic linking, so I'd expect the same behaviour even
though the warning.  The Apple linker is just more picky than the GNU one. 
Looking through the object list, I don't see an object that could carry main. 
I will take a look in the code.

------- Comment #15 From Fabian Groffen 2006-08-27 11:19:45 0000 -------
Created an attachment (id=95218) [edit]
patch for the 42 ebuild

duh...  See diff.  If you agree, you can apply it and close this bug.  You can
include the ~ppc-macos keyword, I hereby grant you my permission for that :)

------- Comment #16 From Radoslaw Stachowiak 2006-08-27 13:12:56 0000 -------
thank You :) /silly me/

First Last Prev Next    No search results available      Search page      Enter new bug