aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: 1 ... 3 4 [5] 6

Author Topic: *REQ* New Universal/Intel Compile  (Read 55689 times)

eisa01

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 100
Re: *REQ* New Universal/Intel Compile
« Reply #60 on: March 26, 2008, 01:16:27 AM »

Don't count on me, I have only a G4, so it'll take an awful lot of time, and I'm really busy ATM.
Hopefully there are some other takers...
Logged

isulzer

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 62
Re: *REQ* New Universal/Intel Compile
« Reply #61 on: March 26, 2008, 05:04:30 AM »

Gave it a try. after compiling all the dependencies in universal.... except libgd. which ill ignore for now, i get this error:
Code: [Select]
ldld: library not found for -lcryptopp
collect2: ld returned 1 exit status
: library not found for -lcryptopp
collect2: ld returned 1 exit status
I added both architectures to the makefile for cryptopp522 and it compiled and installed fine... so that shouldnt be the problem. but i dont have this issue with a non universal compile. So...
Heres the configure/make script i use:
Code: [Select]
cd ~/src/amule/universal/wxMac-2.8.7/build
../configure --enable-shared \
        --enable-unicode \
        --disable-debug \
        --disable-debug_gdb \
        --enable-universal_binary
make
cd ~/src/amule/universal/amule-cvs
./configure --disable-systray \
        --disable-gtk \
        --enable-embedded_crypto \
        --enable-cas \
        --enable-webserver \
        --enable-amulecmd \
        --without-wxdebug \
        --with-wx-config=../wxMac-2.8.7/build/wx-config \
        --disable-debug \
        --enable-optimize \
        --with-cryptopp=/usr/local/cryptopp \
        --disable-dependency-tracking \
        CFLAGS="-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk" \
        CXXFLAGS="-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk"
make
./src/utils/scripts/mac_packager


any ideas? It compiles with the header files fine... its seems to be in the link process that the error occurs.

I guess i should add that yeah, i have 3 folders with all the right headers and the library in /usr/local/cryptopp
« Last Edit: March 26, 2008, 05:50:09 AM by isulzer »
Logged

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: *REQ* New Universal/Intel Compile
« Reply #62 on: March 26, 2008, 11:45:26 AM »

Wait, why is it trying to link dynamically? Shouldn't it link cryptopp statically, i.e. /usr/local/lib/libcryptopp.a  instead of lcryptopp?
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: *REQ* New Universal/Intel Compile
« Reply #63 on: March 26, 2008, 12:11:05 PM »

wuischke: It is most likely trying to link statically. Try
Code: [Select]
ld --verbose -lnonexistentto see how the linker searches for libraries.

isulzer: try adding -Wl,--verbose to the link command, this will give you a lot of information and you may be able to find out why it doesn't find -lcryptopp
Logged
concordia cum veritate

isulzer

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 62
Re: *REQ* New Universal/Intel Compile
« Reply #64 on: March 27, 2008, 06:14:23 PM »

K so the reason was: the -isysroot option forces it to use the usr folder in the 10.5 sdk which contains links to the individual libraries of /usr but not for cryptopp. It seems the -isysroot adds the prefix to --with-cryptopp=.
So you either remove the -isysroot option or you add a link or install cryptopp in the right location for it to see it.
Logged

isulzer

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 62
Re: *REQ* New Universal/Intel Compile
« Reply #65 on: March 27, 2008, 07:55:03 PM »

K new question.... what does the --enable-static option do in the amule configure script? I get a strange ld_classic not found error when i try to use it. And when I don't use it, the packaged amule app seems to work fine when i erase all the compiled libraries(wx, cryptopp etc). These are compiled as static though, so it  auto links them as static. I was wondering what happens with the dynamic libraries i have..

If this is unnecessary, then i have a working universal(all3 ppc architectures as some people still have g3s and intel) compile that should work on tiger and leopard... with the only lack being gdlib as i cant seem to get the damned thing compiled for both architectures as it has some incompatible with multi architecture compiler options... or so it tells me.
« Last Edit: March 27, 2008, 07:58:57 PM by isulzer »
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: *REQ* New Universal/Intel Compile
« Reply #66 on: March 27, 2008, 08:18:57 PM »

--enable-static will prefer static linkage over dynamic whenever both versions of a library are available. Note that this will most likely link statically to the system runtime libraries too, resulting in a HUGE executable file.
Logged
concordia cum veritate

isulzer

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 62
Re: *REQ* New Universal/Intel Compile
« Reply #67 on: March 27, 2008, 08:25:15 PM »

So its not necessary that i add this configure option? Because it does strange things to the linker... Well i can always post the package and see if people can run it without having installed those libraries...
Logged

isulzer

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 62
Re: *REQ* New Universal/Intel Compile
« Reply #68 on: March 27, 2008, 09:36:33 PM »

k so what im getting when i add --enable-static is this:
Code: [Select]
gcc -DHAVE_CONFIG_H -I. -I. -I../../..      -arch ppc -arch i386 -no-cpp-precomp -D_INTL_REDIRECT_MACROS -DNOPCH  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONS -c -o cas-cas.o `test -f 'cas.c' || echo './'`cas.c
gcc -DHAVE_CONFIG_H -I. -I. -I../../..      -arch ppc -arch i386 -no-cpp-precomp -D_INTL_REDIRECT_MACROS -DNOPCH  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONS -c -o cas-configfile.o `test -f 'configfile.c' || echo './'`configfile.c
gcc -DHAVE_CONFIG_H -I. -I. -I../../..      -arch ppc -arch i386 -no-cpp-precomp -D_INTL_REDIRECT_MACROS -DNOPCH  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONS -c -o cas-functions.o `test -f 'functions.c' || echo './'`functions.c
functions.c: In function 'get_path':
functions.c:84: warning: pointer targets in passing argument 3 of 'CFURLGetFileSystemRepresentation' differ in signedness
functions.c: In function 'get_path':
functions.c:84: warning: pointer targets in passing argument 3 of 'CFURLGetFileSystemRepresentation' differ in signedness
gcc -DHAVE_CONFIG_H -I. -I. -I../../..      -arch ppc -arch i386 -no-cpp-precomp -D_INTL_REDIRECT_MACROS -DNOPCH  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONS -c -o cas-graphics.o `test -f 'graphics.c' || echo './'`graphics.c
gcc -DHAVE_CONFIG_H -I. -I. -I../../..      -arch ppc -arch i386 -no-cpp-precomp -D_INTL_REDIRECT_MACROS -DNOPCH  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONS -c -o cas-html.o `test -f 'html.c' || echo './'`html.c
gcc -DHAVE_CONFIG_H -I. -I. -I../../..      -arch ppc -arch i386 -no-cpp-precomp -D_INTL_REDIRECT_MACROS -DNOPCH  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONS -c -o cas-lines.o `test -f 'lines.c' || echo './'`lines.c
gcc  -arch ppc -arch i386 -no-cpp-precomp -D_INTL_REDIRECT_MACROS -DNOPCH  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONS  -mmacosx-version-min=10.4 -force_cpusubtype_ALL -bind_at_load -L/usr/lib -static  -lpthread -o cas -framework CoreServices cas-cas.o cas-configfile.o cas-functions.o cas-graphics.o cas-html.o cas-lines.o     -lz
ld_classicld_classic: for architecture ppc
ld_classic: can't locate file for: -lcrt0.o
: for architecture i386
ld_classic: can't locate file forcollect2: : -lcrt0.o
ld returned 1 exit status
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/tJ/tJ03GWjfGIea22qP85t2CU+++TI/-Tmp-//ccfElzzU.out (No such file or directory)
make[5]: *** [cas] Error 1

There is no library installed anywhere called crt0.o however there is one called crt1.o in /usr/lib/ as well as crt2 and crt3 elsewhere... i have no idea what crt0 is or where to get it. google turns up nothing usable.
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: *REQ* New Universal/Intel Compile
« Reply #69 on: March 27, 2008, 10:04:39 PM »

crt0.o should be part of the runtime libs, actually this calls ‘main()’. gcc calls it crtbegin.o. Such an error message means something very bad.

Can you compile any program (e.g. a  ‘Hello World’ example) statically (i.e. gcc -static helloworld.c)?
Logged
concordia cum veritate

isulzer

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 62
Re: *REQ* New Universal/Intel Compile
« Reply #70 on: March 27, 2008, 10:07:15 PM »

nop. means something is really really screwy... ill figure it out...
Logged

isulzer

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 62
Re: *REQ* New Universal/Intel Compile
« Reply #71 on: March 27, 2008, 10:31:26 PM »

heres what apple says:
Quote
Static linking of user binaries is not supported on Mac OS X. Tying user binaries to the internal implementation of Mac OS X libraries and interfaces would limit our ability to update and enhance Mac OS X. Instead, dynamic linking is supported (linking against crt1.o automatically instead of looking for crt0.o, for example).

We strongly recommend that you consider the limitations of statically linking very carefully, and consider your customer and their needs, plus the long-term support you will need to provide. Apple provides support and attempts to insure complete compatibility through the published APIs, but cannot insure that compatibility in a statically linked project. Any change to Mac OS X, in a system update, security update, or major revision, may break statically linked code.

If your project absolutely must link statically and need crt0.o, you can get the Csu module from Darwin and try building crt0.o statically. Please bear in mind that you must then clearly specify to your customers the compatibility risks involved in installing a product that relies on statically linked code.

I guess ill try what they say.
Although... it would probably be best to chose the static library versions manually, for everything that is necessary. how would I do this?
Oh wait never mind.. theres a ld option that makes it preffer .a over .dylib i think. ill try that...
« Last Edit: March 27, 2008, 11:07:04 PM by isulzer »
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: *REQ* New Universal/Intel Compile
« Reply #72 on: April 01, 2008, 10:30:53 AM »

Which is the option, for reference?
Logged

isulzer

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 62
Re: *REQ* New Universal/Intel Compile
« Reply #73 on: April 01, 2008, 07:26:10 PM »

the ld thing? never mind. i misread the man file. it was an option that searched a path then looked got .dylib first, then .a. I flipped em.
some ld do come with a way to prefer static over dynamic, but not the osx version. I guess. -lLIB.a for each of the required libs should work to make it use static
« Last Edit: April 01, 2008, 08:26:45 PM by isulzer »
Logged

isulzer

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 62
Re: *REQ* New Universal/Intel Compile
« Reply #74 on: April 01, 2008, 09:27:26 PM »

ok. so that dosent work either. cant specify the .a as a link option. only in linker input files. Even creating a new location with only static libraries and using the -LPATH option to prefer that path.... does not work, since the osx linker prefers a dynamic lib over a static, no matter the order of the search paths. Since there are dylib versions.. id have to delete all of them... hah.

So my only solution is to add it to the linker inputs by hand? ie /opt/local/lib/libiconv.a for libiconv... does the amule configure script allow me to specify the particular library? or just the prefix? If not then i would have to manually compile and install into a directory to use with PREFIX that only had a static version....
Logged
Pages: 1 ... 3 4 [5] 6