Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gcc 2.95 compiled plugin with mozilla compiled with 3.1(fix)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
neuron
Advocate
Advocate


Joined: 28 May 2002
Posts: 2371

PostPosted: Wed Jun 12, 2002 12:05 am    Post subject: gcc 2.95 compiled plugin with mozilla compiled with 3.1(fix) Reply with quote

http://hints.linuxfromscratch.co.uk/hints/mozilla.txt

the interesting part: (in case the link dies, all credit to the original author Tushar Teredesai <Tush@Yahoo.Com>)

GCC 3 Tips:

If you compile Mozilla using GCC3, closed source plug-ins such as flash will
crash Mozilla since these plug-ins are compiled using GCC2. A work-around till
the plug-ins are fixed is to pre-load a library that will make some required
functions available to these plug-ins. Unfortunately, the Java Plugin does not
work using this approach.

Do the following.
cat > libc++mem.c << "EOF"
// From http://bugzilla.mozilla.org/show_bug.cgi?id=124006
void *__builtin_new(int size) {return (void*)malloc(size);}
void *__builtin_vec_new(int size) {return __builtin_new(size);}
void *__builtin_delete(void *ptr) {free(ptr);}
void *__builtin_vec_delete(void *ptr) {__builtin_delete(ptr);}
EOF
gcc -shared -fPIC -o libc++mem.so libc++mem.c &&
mv libc++mem.so /opt/mozilla

Open /opt/mozilla/run-mozilla.sh and just below line 351 enter
export LD_PRELOAD=/opt/mozilla/libc++mem.so


Installing Adobe Acrobat Plugin:

Download the Acrobat Reader from Adobe's website.
http://www.adobe.com/products/acrobat/readstep2.html

Install Acrobat in /opt/acrobat. Now link the plugin.
cd /opt/mozilla/plugins &&
ln -s /opt/acrobat/Browsers/intellinux/nppdf.so


Installing Java Plugin:

Download IBM JRE 1.3 from IBM's website.
http://www.alphaworks.ibm.com/

Install IBM JDK in /opt/IBMJava2-13 and then link the plugin.
cd /opt/mozilla/plugins &&
ln -s /opt/IBMJava2-13/jre/bin/libjavaplugin_oji.so

Some alternative java plugins:
http://java.sun.com/j2se/
http://www.blackdown.org/

I am trying to figure out how to compile JRE from scratch so that it can be
linked against gcc3 libraries and would be suitable for gcc3 compiled mozilla.
If you have any thoughts, let me know. I am planning to check out the Open
Source VMs like Japhar and Kaffe.


Installing Macromedia Flash Player:

Download the Flash Player from Macromedia's website.
http://sdc.shockwave.com/shockwave/download/alternates/#linux

Untar the files.
cp libflashplayer.so ShockwaveFlash.class /opt/mozilla/plugins


Installing RealPlayer:

Download the plugin from Real Networks.
http://forms.real.com/real/player/unix/unix.html

Install RealPlayer in /opt/RealPlayer8 and then copy the plugin to mozilla's
plugin directory.
cp rpnp.so raclass.zip /opt/mozilla/plugins


CodeWeaver's CrossOver Plugin:

If you are interested in using Windows plugins, this commercial product will
allow you to do it. Check out:
http://www.codeweavers.com/products/crossover/
for more info.
Back to top
View user's profile Send private message
Vanquirius
Retired Dev
Retired Dev


Joined: 14 Jun 2002
Posts: 1297
Location: Ethereal plains

PostPosted: Mon Jun 17, 2002 6:19 am    Post subject: re: Reply with quote

very helpful post :)

I just would like to note that instead of "/opt/mozilla", at least on my build invoked with "emerge mozilla", my mozilla directory is "/usr/lib/mozilla". Hope that can help save an extra second in the process for other ppl like me :)
_________________
Hello.
Back to top
View user's profile Send private message
MadEgg
l33t
l33t


Joined: 06 Jun 2002
Posts: 678
Location: Netherlands

PostPosted: Mon Jun 17, 2002 9:05 am    Post subject: Reply with quote

I can't even get Mozilla to compile with GCC 3.1 What CFLAGS do you use?
I tried
-march=i686 -O3 -pipe
-march=i686 -O2 -pipe
-march=i686 -O2 -pipe -mno-mmx

And the same with Pentium4 as arch, not i686...
_________________
Pentium 4 Prescott 3,2 GHz
Asus P4P800 SE, i865PE chipset
1024 MB PC3200 RAM
AOpen Aeolus GeForce 6800 Ultra 256 MB DDR2
Creative Audigy2 ZS
gentoo-sources-2.6.20-r7
nVidia-drivers version 9755
Back to top
View user's profile Send private message
Vanquirius
Retired Dev
Retired Dev


Joined: 14 Jun 2002
Posts: 1297
Location: Ethereal plains

PostPosted: Mon Jun 17, 2002 2:11 pm    Post subject: Reply with quote

I used:
CFLAGS="-march=i686 -O3 -pipe -funroll-loops -fomit-frame-pointer -m3dnow -mmmx"
and the same thing for CXXFLAGS

the build id of my mozilla is 2002061620, and the compilation process went without flaws, as well as the "turn-around" plugin option posted here
_________________
Hello.
Back to top
View user's profile Send private message
baz
n00b
n00b


Joined: 21 Jun 2002
Posts: 9

PostPosted: Fri Jun 21, 2002 12:27 pm    Post subject: Reply with quote

The above fix does nothing for me. I installed my system from the 1.3b tarball, and compiled everything with gcc3.

Installed the Flash plugins, and every time I go to a site with Flash on it, I get the crash message (something about __builtin_vec_new) that's been posted elsewhere, and the browser utterly dies.

Here's what I've done, trying to make sense of the instructions above:

Code:

su root
cat > libc++mem.c << "EOF"
// From http://bugzilla.mozilla.org/show_bug.cgi?id=124006
void *__builtin_new(int size) {return (void*)malloc(size);}
void *__builtin_vec_new(int size) {return __builtin_new(size);}
void *__builtin_delete(void *ptr) {free(ptr);}
void *__builtin_vec_delete(void *ptr) {__builtin_delete(ptr);}
EOF
gcc -shared -fPIC -o libc++mem.so libc++mem.c &&
mv libc++mem.so /usr/lib/mozilla


I then altered /usr/lib/mozilla/run-mozilla.sh to read:

Code:

...
    349 ## Set MOZILLA_FIVE_HOME
    350 ##
    351 MOZILLA_FIVE_HOME=$MOZ_DIST_BIN
    352
    353 export LD_PRELOAD=/usr/lib/mozilla/libc++mem.so
    354
    355 if [ -z "$MRE_HOME" ]; then
    356     MRE_HOME=$MOZILLA_FIVE_HOME
    357 fi
    358 ##
    359 ## Set LD_LIBRARY_PATH
...


Is that LD_PRELOAD line in the right place? Because it's made no difference at all. I've restart X, rebooted, and uninstalled/reinstalled the flash plugin, but to no avail. Still the same error message.

Any ideas?
Back to top
View user's profile Send private message
chrisjs
n00b
n00b


Joined: 21 Jun 2002
Posts: 33

PostPosted: Fri Jun 21, 2002 8:21 pm    Post subject: Change the way you export Reply with quote

baz wrote:


I then altered /usr/lib/mozilla/run-mozilla.sh to read:

Code:

...
    349 ## Set MOZILLA_FIVE_HOME
    350 ##
    351 MOZILLA_FIVE_HOME=$MOZ_DIST_BIN
    352
    353 export LD_PRELOAD=/usr/lib/mozilla/libc++mem.so
    354
    355 if [ -z "$MRE_HOME" ]; then
    356     MRE_HOME=$MOZILLA_FIVE_HOME
    357 fi
    358 ##
    359 ## Set LD_LIBRARY_PATH
...


Is that LD_PRELOAD line in the right place? Because it's made no difference at all. I've restart X, rebooted, and uninstalled/reinstalled the flash plugin, but to no avail. Still the same error message.

Any ideas?


You may wish to try:
Code:
LD_PRELOAD=/usr/lib/mozilla/libc++mem.so
export LD_PRELOAD

instead. The way env vars get exported varies depending on what shell you are using. Don't know if this is your problem but worth a shot.
Back to top
View user's profile Send private message
baz
n00b
n00b


Joined: 21 Jun 2002
Posts: 9

PostPosted: Sat Jun 22, 2002 3:42 pm    Post subject: Reply with quote

Nope, makes no difference at all :(
Back to top
View user's profile Send private message
dook43
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jun 2002
Posts: 114
Location: Baton Rouge, LA

PostPosted: Sat Jun 22, 2002 8:15 pm    Post subject: optimizations Reply with quote

Just use the binary install of mozilla from mozilla.org for now. As long is your kernel and other apps (X!) are fully optimized, you won't really see TOO much of a difference.
_________________
"We who are about to die salute you!"
Back to top
View user's profile Send private message
baz
n00b
n00b


Joined: 21 Jun 2002
Posts: 9

PostPosted: Sat Jun 22, 2002 11:31 pm    Post subject: Reply with quote

Ok, but how would that fit in with the portage scheme of things? Eg. galeon depends on the ebuild of mozilla being installed. Not sure how to go about this :?
Back to top
View user's profile Send private message
Jyrinx
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2002
Posts: 92
Location: Carleton College - Northfield, MN

PostPosted: Sun Jun 23, 2002 2:07 am    Post subject: Reply with quote

I suppose you could install the binary version as normal, then do "emerge --inject mozilla".
Back to top
View user's profile Send private message
ves
n00b
n00b


Joined: 17 Apr 2002
Posts: 30

PostPosted: Sun Jun 23, 2002 6:56 am    Post subject: Reply with quote

hmm...i still can't get java to work. Flash works fine though. Any ideas?

here's a chunk of my plugins directory...

Code:
lrwxrwxrwx    1 root     root           66 Jun 13 15:35 javaplugin_oji.so -> /op                                                                                                   t/blackdown-jdk-1.3.1/jre/plugin/i386/mozilla/javaplugin_oji.so
-rwxr-xr-x    1 root     root       948056 Jun 12 07:35 libflashplayer.so
lrwxrwxrwx    1 root     root           61 Jun 22 23:53 libjavaplugin_oji.so ->                                                                                                    /opt/sun-jdk-1.4.0/jre/plugin/i386/ns610/libjavaplugin_oji.so
lrwxrwxrwx    1 root     root           64 Jun 19 00:45 libjavaplugin_oji140.so                                                                                            -> /opt/sun-jdk-1.4.0/jre/plugin/i386/ns610/libjavaplugin_oji140.so
Back to top
View user's profile Send private message
baz
n00b
n00b


Joined: 21 Jun 2002
Posts: 9

PostPosted: Sun Jun 23, 2002 2:58 pm    Post subject: Reply with quote

The original poster did say that the Java plugin will not work with this method. Apparently you'd have to compile the jre from scratch with gcc3.
Back to top
View user's profile Send private message
neuron
Advocate
Advocate


Joined: 28 May 2002
Posts: 2371

PostPosted: Fri Jul 12, 2002 12:14 pm    Post subject: Reply with quote

bump, could a mod stick this, starting to be posted quite a few questions about mozilla and gcc3.1
Back to top
View user's profile Send private message
daroz
n00b
n00b


Joined: 20 Jun 2002
Posts: 12

PostPosted: Sat Jul 13, 2002 6:23 pm    Post subject: Reply with quote

Not for the meek at heart, but there is a 'how-to' of sorts on how to go about compiling your own java runtime and plugin here...

http://hints.linuxfromscratch.org/hints/javafromscratch.txt

Notes:
1. I did need to get a SUN 1.4.x JRE first (you can't use the blackdown 1.3 in the portage tree, it's got to be 1.4)
2. At the time I did this I had Blackdown JRE 1.3.x emerged on my system.
3. Before compiling he has you download a 'gcc2' libstdc++ library from his site. I did not need to do this.
4. I attempted to compile -=before=- applying his patch. This did warn me that the compiling process uses a TON of diskspace. As I was on my (older) notebook with a 4GB HD -- it actually made for a tight fit. I do not recall ATM the exact amount needed.
5. After compiling I -=manually=- put the Sun 1.4 gcc3 JRE into /opt, but did NOT change and java-related envionment variables. This effectively left my standard running java with the Blackdown 1.3 JRE. (I rarely use Java - except this one site I view that has this annoying-as-hell applet. So I didn't intend to use my compiled version other then with Mozilla.)

Hope this helps you all out...
Back to top
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Sat Jul 13, 2002 6:28 pm    Post subject: Reply with quote

neuron wrote:
bump, could a mod stick this, starting to be posted quite a few questions about mozilla and gcc3.1

Seems like a good idea... stickifying.
_________________
I don't believe in witty sigs.
Back to top
View user's profile Send private message
DArtagnan
l33t
l33t


Joined: 30 Apr 2002
Posts: 942
Location: Israel, Jerusalem

PostPosted: Sun Jul 14, 2002 7:02 pm    Post subject: Re: gcc 2.95 compiled plugin with mozilla compiled with 3.1( Reply with quote

neuron wrote:
http://hints.linuxfromscratch.co.uk/hints/mozilla.txt

the interesting part: (in case the link dies, all credit to the original author Tushar Teredesai <Tush@Yahoo.Com>)

GCC 3 Tips:

If you compile Mozilla using GCC3, closed source plug-ins such as flash will
crash Mozilla since these plug-ins are compiled using GCC2. A work-around till
the plug-ins are fixed is to pre-load a library that will make some required
functions available to these plug-ins. Unfortunately, the Java Plugin does not
work using this approach.

Do the following.
cat > libc++mem.c << "EOF"
// From http://bugzilla.mozilla.org/show_bug.cgi?id=124006
void *__builtin_new(int size) {return (void*)malloc(size);}
void *__builtin_vec_new(int size) {return __builtin_new(size);}
void *__builtin_delete(void *ptr) {free(ptr);}
void *__builtin_vec_delete(void *ptr) {__builtin_delete(ptr);}
EOF
gcc -shared -fPIC -o libc++mem.so libc++mem.c &&
mv libc++mem.so /opt/mozilla

Open /opt/mozilla/run-mozilla.sh and just below line 351 enter
export LD_PRELOAD=/opt/mozilla/libc++mem.so
.................


I have no /opt/mozilla directory
Code:

liviu@javastorm opt $ ls -la
total 20
drwxr-xr-x    3 root     root         4096 Jul 14 20:59 .
drwxr-xr-x   17 root     root         4096 Jul 13 20:29 ..
-rw-r--r--    1 root     root            0 Jul 13 01:29 .keep
-rwxr-xr-x    1 liviu    wheel        5966 Jul 14 20:58 mozilla
drwxr-xr-x    7 root     root         4096 Jul 13 20:21 sun-jdk-1.4.0


Then, how can i edit the '/opt/mozilla/run-mozilla.sh' ?
_________________
All for one and one for All
--

MACPRO machine...
Back to top
View user's profile Send private message
neuron
Advocate
Advocate


Joined: 28 May 2002
Posts: 2371

PostPosted: Mon Jul 15, 2002 1:17 am    Post subject: Reply with quote

find / -name run-mozilla.sh

;)
Back to top
View user's profile Send private message
DArtagnan
l33t
l33t


Joined: 30 Apr 2002
Posts: 942
Location: Israel, Jerusalem

PostPosted: Mon Jul 15, 2002 4:58 am    Post subject: Reply with quote

neuron wrote:
find / -name run-mozilla.sh

;)


/usr/lib/mozilla/run-mozilla.sh

:-)
_________________
All for one and one for All
--

MACPRO machine...
Back to top
View user's profile Send private message
DJ-Lucas
n00b
n00b


Joined: 15 Jul 2002
Posts: 5
Location: St. Louis, MO

PostPosted: Fri Jul 19, 2002 7:03 pm    Post subject: Reply with quote

I was just coming in to mention Tush's hint..lol LFS'er here getting ready to Gentoo for the first time. There are actually a lot of patches burried in the devel list for LFS if anybody hasn't doubled the work here yet and want's to use them on their gentoo systems. Burried deep lol. But was gonna mention also, a interesting post I found in the LFS devel list...perhaps this could be passed on to the developers...or maybe a nice reply should be given to the author of that post.

Quote:
I
installed a cvs snap of gcc-3.1.1 (about to be released - yeah
right!)

Build of glibc-2.2.5 will bomb unless the following patch is
applied. I stole this from the stable glibc-2.2.6 branch of
cvs. And for the record, this is slightly different to the
patch the gentoo guys are using. Their's is wrong.

http://sources.redhat.com/ml/libc-hacker/2002-05/msg00024.html

for reference.



Any body know bout this? Since I haven't done gentoo..I'm unable to comment. Perhaps this should have been posted to devel after all... Mod please move if this is not the appropriate place.

Hope this is usefull,

DJ
Back to top
View user's profile Send private message
neuron
Advocate
Advocate


Joined: 28 May 2002
Posts: 2371

PostPosted: Sat Jul 20, 2002 12:42 pm    Post subject: Reply with quote

DJ-Lucas, is this mozilla related? if not, make a new thread for it :)
Back to top
View user's profile Send private message
Locke
n00b
n00b


Joined: 02 Aug 2002
Posts: 50
Location: Baton Rouge, LA, US

PostPosted: Sun Aug 11, 2002 7:55 pm    Post subject: Reply with quote

This does absolutely nothing for me... any attempt to use any plugin results in a crash :-/

RP8 does work, however, outside of the browser. And Flash (presumably Crossover too, once I figure out how) works fine in Opera.
_________________
---BEGIN GEEK CODE BLOCK---
GH/MU d+ s+:+>+: a--- C++ UL+++>++++ P>++ L+++(++) E- W++(-) N+ o?
K+ w !O M-- !V PS+@ PE Y+ PGP t 5 X- R-@ tv- b+++ DI+ D G e>++++ h- r y
---END GEEK CODE BLOCK---
Back to top
View user's profile Send private message
Locke
n00b
n00b


Joined: 02 Aug 2002
Posts: 50
Location: Baton Rouge, LA, US

PostPosted: Sun Aug 11, 2002 10:42 pm    Post subject: Reply with quote

Hmm Crossover won't work in Opera either :(
_________________
---BEGIN GEEK CODE BLOCK---
GH/MU d+ s+:+>+: a--- C++ UL+++>++++ P>++ L+++(++) E- W++(-) N+ o?
K+ w !O M-- !V PS+@ PE Y+ PGP t 5 X- R-@ tv- b+++ DI+ D G e>++++ h- r y
---END GEEK CODE BLOCK---
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Mon Aug 19, 2002 2:59 am    Post subject: Reply with quote

GCC3 to Documentation, Tips & Tricks. Unstuck.

Moved to Portage & Programming, as it seems a bit old for DT&T. 2004.DEC --pjp
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
maor
Guru
Guru


Joined: 28 Aug 2002
Posts: 323

PostPosted: Thu Sep 05, 2002 12:58 pm    Post subject: Reply with quote

didn't work for me still serch solution for flash.
Back to top
View user's profile Send private message
pilla
Administrator
Administrator


Joined: 07 Aug 2002
Posts: 7232
Location: Pelotas, BR

PostPosted: Tue Sep 24, 2002 2:47 pm    Post subject: Reply with quote

for galeon: edit /usr/bin/galeon and add to the fourth line....

Code:

export LD_PRELOAD=/usr/lib/mozilla/libc++mem.so
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum