You are not logged in.

#1 2005-07-28 17:14:46

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

c++: -O1: linker input file unused because linking not done

This looks bad - I have seen it all my recent compiles but can't remeber when it started - did i break something or did pacman?

Offline

#2 2005-07-30 11:33:34

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: c++: -O1: linker input file unused because linking not done

I'm seeing it too dibble - haven't a clue what it means at the moment though.

<edit>
Found this explanation - leaves me none the wiser, but maybe you or someone else knows what they're talking about.  :?

Offline

#3 2005-07-30 11:56:53

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: c++: -O1: linker input file unused because linking not done

Looks like it simply the code we happen to be compiling has been poorly written and included commands that don't need to be there smile

No prob I can see...but I'm no c expert

Offline

#4 2005-08-02 06:15:00

Disc-Devil
Member
Registered: 2005-03-07
Posts: 33

Re: c++: -O1: linker input file unused because linking not done

This, has nothing todo with poorly written code. From my investigation, while restarting the Arch -i586 project, i discovered the following:

Current CFLAGS

-march=i686 -O2 -pipe -W1,-O1

In this case, the -O1 is supposed to be passed on to the linker, however, when calling the linker from what the term now was (from the man page), it's better to use the following:

-march=i686  -O2 -pipe -W1,--startgroup -O1 -W1,--endgroup

This cause the option, to actually be passed correctly to the linker, when passing it from a shell script.

There is from what i know so far, 1 package the fails, if using the wrong one. After the change to this, it worked.

I just can not remeber wich package it was.. But try this, and se if it works.

Enjoy!

// Disc-Devil

Offline

#5 2005-08-02 06:31:51

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: c++: -O1: linker input file unused because linking not done

Yeah - it's a CFLAGS issue (not a *real* issue , mind you)... in essence, you are passing linker flags when gcc is not (yet) doing the linking portion....

Offline

#6 2005-08-02 06:45:17

Disc-Devil
Member
Registered: 2005-03-07
Posts: 33

Re: c++: -O1: linker input file unused because linking not done

Well, regardless, if it is a "real" issue or not, I think, most of us prefer to, not see an error/warning if it is avoidable.

As it was stated in the man page for ld, sometimes, when calling it (pasing options) interactive (is this the term?) it sometimes "messes" up, and it is better to use the suggested, so that the compoiler knows, that >this< is not my buisness, i'll give it to ld or something like that.

mm, i dont know, if im making any sence at all, i could, for all i know, be far away from actuall thruth.. but, it did make the warning/error go away big_smile

Cheers!

[# 1 edit in total - My spelling sux]

Offline

#7 2005-08-02 15:14:23

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: c++: -O1: linker input file unused because linking not done

Disc-Devil wrote:

Well, regardless, if it is a "real" issue or not, I think, most of us prefer to, not see an error/warning if it is avoidable.

So remove the linker flags from makepkg.conf - problem solved

Disc-Devil wrote:

As it was stated in the man page for ld, sometimes, when calling it (pasing options) interactive (is this the term?) it sometimes "messes" up, and it is better to use the suggested, so that the compoiler knows, that >this< is not my buisness, i'll give it to ld or something like that.

mm, i dont know, if im making any sence at all, i could, for all i know, be far away from actuall thruth.. but, it did make the warning/error go away big_smile

I'm not sure what you're saying here... but I think your saying that this issue causes ld to fail?  It shouldn't - that'd be an unrelated issue.  These warning messages are *only* issued by gcc when it detects linker flags and is outputting an object file and not linking object files.

For instance:

gcc -W1,-O1 helloworld.c -o helloworld.o
gcc helloworld.c -o helloworld.o

Will issue the exact same object file (try a diff on them), but the first one will issue the warning, the second will not.

The problem with removing these linker flags is that they are used alot - just not in all programs.

I'm not at my arch box, can someone post the contents of makepkg.conf?

Offline

#8 2005-08-02 16:29:18

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: c++: -O1: linker input file unused because linking not done

phrakture wrote:

I'm not at my arch box, can someone post the contents of makepkg.conf?

Sure.

#
# /etc/makepkg.conf
#

# The FTP/HTTP download utility that makepkg should use to acquire sources
export FTPAGENT="/usr/bin/wget --continue --passive-ftp --tries=3 --waitretry=3 --no-check-certificate"
#export FTPAGENT="/usr/bin/snarf"
#export FTPAGENT="/usr/bin/lftpget -c"

export CARCH="i686"
export CHOST="i686-pc-linux-gnu"

# Pentium Pro/Pentium II/Pentium III+/Pentium 4/Athlon exclusive (binaries
# will use the P6 instruction set and only run on P6+ systems)
export CFLAGS="-march=i686 -O2 -pipe -Wl,-O1"
export CXXFLAGS="-march=i686 -O2 -pipe -Wl,-O1"
# Pentium Pro/Pentium II/Pentium III+/Pentium 4/Athlon optimized (but binaries
# will run on any x86 system)
#export CFLAGS="-mcpu=i686 -O2 -pipe"
#export CXXFLAGS="-mcpu=i686 -O2 -pipe"

# SMP Systems
#export MAKEFLAGS="-j 2"

# Enable fakeroot for building packages as a non-root user
export USE_FAKEROOT="y"

# Enable colorized output messages
export USE_COLOR="y"

# Specify a fixed directory where all packages will be placed
#export PKGDEST=/home/packages

# If you want your name to show up in the packages you build, set this.
#export PACKAGER="John Doe <john@doe.com>"

Offline

#9 2005-08-02 17:29:47

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: c++: -O1: linker input file unused because linking not done

Disc-Devil wrote:

This, has nothing todo with poorly written code.

My mistake

Offline

#10 2005-08-02 18:05:09

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: c++: -O1: linker input file unused because linking not done

switch

export CFLAGS="-march=i686 -O2 -pipe -Wl,-O1"
export CXXFLAGS="-march=i686 -O2 -pipe -Wl,-O1"

to

export CFLAGS="-march=i686 -O2 -pipe"
export CXXFLAGS="-march=i686 -O2 -pipe"
export LDFLAGS="-Wl,-O1"

problem solved

Offline

#11 2005-08-07 19:48:10

Disc-Devil
Member
Registered: 2005-03-07
Posts: 33

Re: c++: -O1: linker input file unused because linking not done

this, looks more like the truth.. altough, im not quite sure, that the -W1 should prefix the -O1 in LDFLAGS.

My ehum, guess, is that it should rather look like this:

LDFLAGS="-O1"

the -W1 is a compiler flag, to let the compiler know, that this >-O1< is for the linker?

and, yes, the default flags, has caused some packages to not build for some weird reason...

But, if this works, it is all good big_smile

Offline

#12 2005-08-07 22:09:51

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: c++: -O1: linker input file unused because linking not done

works ok for me after phrakture's changes smile

Offline

#13 2005-08-08 15:41:52

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: c++: -O1: linker input file unused because linking not done

Disc-Devil wrote:

this, looks more like the truth.. altough, im not quite sure, that the -W1 should prefix the -O1 in LDFLAGS.

My ehum, guess, is that it should rather look like this:

LDFLAGS="-O1"

Hah, you got it - it was a blind copy paste, but you're right... it should be "-O1" without the -Wl prefix (which indicates 'ignore this and pass it to the linker')

Offline

#14 2005-08-08 15:53:50

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: c++: -O1: linker input file unused because linking not done

roll bloody hell phrak!

Offline

Board footer

Powered by FluxBB