Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 29783 - super-freeswan compilation error with GCC3.3.1
Summary: super-freeswan compilation error with GCC3.3.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-27 20:54 UTC by Prabhat Gupta
Modified: 2003-10-04 21:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to replace -omit-frame-pointer with -fomit-frame-pointer (bug29783.patch,2.02 KB, patch)
2003-10-02 10:57 UTC, Joshua Kinard
Details | Diff
Diff to super-freeswan-1.99.7.3 ebuild to add previous patch (bug29783-ebuild.patch,720 bytes, patch)
2003-10-02 12:57 UTC, Joshua Kinard
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Prabhat Gupta 2003-09-27 20:54:06 UTC
Hi,

I am trying to compile super-freeswan with gcc3.3.1 (~x86). I get many of the
following type errors:

gcc -O3 -omit-frame-pointer -I../include    -c -o hmac_sha2.o hmac_sha2.c
cc1: error: unrecognized option `-strip'

I found out that if we change "-omit-frame-pointer" to "-fomit-frame-pointer"
the problem goes away.


Reproducible: Always
Steps to Reproduce:
1.use CSH, gcc-3.3.1 (~x86)
2. emerge super-freswan |& tee LOG
3. Search log for "error"
Comment 1 Joshua Kinard gentoo-dev 2003-10-02 02:35:19 UTC
I did a scan of the super-freeswan ebuilds, and found no mention of -fomit-frame-pointer
in them.  Can you check the CFLAGS you have set in /etc/make.conf and see
if you may have accidentially mispelled -fomit-frame-pointer in there?

You also mention using "csh" as a shell (I think) and then emerging.  Is
this a possible sideeffect?
Comment 2 Prabhat Gupta 2003-10-02 06:07:37 UTC
CSH shell was not a problem as I was getting the same error in bash also.

I will scan my make.conf when I reach home today but I think, it is correct.

I downloaded the freeswan package from the site specified in the ebuild,
unpacked it and found the many of the Makefiles have -omit-frame-pointer
not -fomit-frame-pointer as CFLAG.

I don't know how to write a patch and I don't want to install the freeswan
directly without ebuild :(

Here is one makefile:
--------------------------------------------------------------
.../super-freeswan-1.99.7.3/libcrypto/libsha2

CFLAGS=-O3 -omit-frame-pointer -I../include $(EXTRA_CFLAGS)

LIBOBJ := hmac_sha2.o sha2.o

BLIB := libsha2.a

.S.o:
	$(CC) $(AFLAGS) -c $< -o $@

$(BLIB): $(LIBOBJ)
	/bin/rm -f $(BLIB)
	ar cr $(BLIB) $(LIBOBJ)
	-if test -s /bin/ranlib; then /bin/ranlib $(BLIB); \
	else if test -s /usr/bin/ranlib; then /usr/bin/ranlib $(BLIB); \
	else exit 0; fi; fi

test: test_main.o $(BLIB)
	$(CC) -o $@ $^ 

clean:
	rm -f *.[oa] core $(TARGET) test
------------------------------------------------------------------------


Prabhat
Comment 3 jochen 2003-10-02 09:40:04 UTC
problem is -omit-frame-pointer in those Makefiles. should be -fomit-frame-pointer

I don't know, why -omit-frame-pointer is accepted by gcc anyway, I'd call
this a bug.

so, actually two bugs here:

a) gcc should barf on -omit-frame-pointer
b) super-freeswan Makefiles should use -fomit-frame-pointer

$ gcc --help -v 2>&1 | grep omit-frame-pointer
  -fomit-frame-pointer    When possible do not generate stack frames
$
Comment 4 Joshua Kinard gentoo-dev 2003-10-02 10:57:21 UTC
Created attachment 18608 [details, diff]
Patch to replace -omit-frame-pointer with -fomit-frame-pointer

Give this patch a try and see if it allows super-freeswan to compile for
you. 
If it does, I'll add it to the ebuild.
Comment 5 Prabhat Gupta 2003-10-02 11:15:30 UTC
I forgot to mention that the super-freeswan depends on libpcap. libpcap is
not fetched automatically by ebuild.

http://sourceforge.net/projects/libpcap/

I will try the patch in the evening.

So, to apply the patch, I have to download the package from www.freeswan.ca,
unpack it and then go to 

cd super-freeswan-1.99.7.3

patch -p1 < <your patch>

is this correct?

Comment 6 Joshua Kinard gentoo-dev 2003-10-02 12:57:02 UTC
Created attachment 18617 [details, diff]
Diff to super-freeswan-1.99.7.3 ebuild to add previous patch

Here's a better (and quicker) idea.

First, Take this patch I have provided, it will modify the
super-freeswan-1.99.7.3 ebuild to add in the appropriate lines to apply the
other patch I provided.

Simply save it, and move this patch to the /usr/portage/net-misc/super-freeswan
folder.  Apply the patch from there, and it will modify the ebuild.  You
can
then delete this patch, as it's no longer needed.

Next, save the original patch I posted, and move it to
/usr/portage/net-misc/super-freeswan/files.  Give the patch this name:
"super-freeswan-1.99.7.3-bad-cflags-fix.patch".

Next, change to the super-freeswan directory and run "ebuild
super-freeswan-1.99.7.3.ebuild digest compile".  This will regenerate the
digest files and then unpack and compile the package.  During the source
unpacking phase, you will see the above patch applied.	If the above patch
fails for any reason, let me know.  Otherwise, it will have modified
approximately four Makefiles (the only four I found with -omit-frame-pointer).

If it unpacks successfully, it will then move onto the compiling phase, and
if
that completes successfully, then the patch is successful.  If this becomes
the
case, post here that the patch succeeded, and I'll put the patch into Portage
so that it fixes this bug permanently.
Comment 7 Prabhat Gupta 2003-10-02 17:51:01 UTC
I am trying to apply the patch on the ebuild with following command:

patch < bug29783-ebuild.patch

This is giving error. What is the correct command for applying patch?

I am sorry for too simple questions.
Comment 8 Prabhat Gupta 2003-10-03 21:11:11 UTC
I am able to apply your first patch and it works perfect but I can't apply
the patch to the ebuild. I guess, you will check-in the modified ebuild.

Thanks
Prabhat
Comment 9 Joshua Kinard gentoo-dev 2003-10-04 21:26:01 UTC
Resolving as FIXED; Patch is in CVS.
Comment 10 Joshua Kinard gentoo-dev 2003-10-04 21:26:18 UTC
Oops, wrong status change...