PDA

View Full Version : how to identify what version of gcc was used?



kcy29581
August 23rd, 2007, 12:06 PM
Hi all,

I bet this is easy...

How can identify which version of gcc compiled an application?

Thanks

ghostdog74
August 23rd, 2007, 12:30 PM
what did the man page say.. don't be lazy. read the man page

kcy29581
August 23rd, 2007, 12:53 PM
...

I do not have access to the man page; I'm at work and using MSYS. Google hasn't yielded anything yet either. I do not have access to my Linux PC at the moment. I'll try gcc's site now.

So, please, if you know the command, what is it?

ghostdog74
August 23rd, 2007, 01:04 PM
...
Google hasn't yielded anything yet either.
its as simple as typing "how to find gcc version" in google. The first return result says it all. Now that isn't hard at all right?

kcy29581
August 23rd, 2007, 01:10 PM
its as simple as typing "how to find gcc version" in google. The first return result says it all. Now that isn't hard at all right?

if you are talking about:
gcc -v then I implore you to read the question before answering, especially when you are "trying" to patronise people.
The question was:
How can identify which version of gcc compiled an application

To put it even simply for you to understand, someone compiled an application, I need to verify they used a specific version of gcc; how do I do that?

fct
August 23rd, 2007, 02:18 PM
As far as I know normally there is no information about the compiler version added to executables. You can use "ldd" to check the libraries linked, though. The command "file" also outputs some helpful info on binaries, like the architecture it was compiled for.

kcy29581
August 23rd, 2007, 02:30 PM
As far as I know normally there is no information about the compiler version added to executables. You can use "ldd" to check the libraries linked, though. The command "file" also outputs some helpful info on binaries, like the architecture it was compiled for.

Thanks fct.

Unfortunately neither of those two commands appear to work on MSYS. I'll have to wait until tomorrow when my Linux development PC is set up.

It's crazy though, we have to verify gcc versions for executables, but they don't tell us how. Typical work! :)

LaRoza
August 23rd, 2007, 02:33 PM
It's crazy though, we have to verify gcc versions for executables, but they don't tell us how. Typical work! :)

If they don't know how, and you don't know, how will they know you're not making it up? :D

kcy29581
August 23rd, 2007, 02:46 PM
If they don't know how, and you don't know, how will they know you're not making it up? :D

I work for a games development company, and the game we're working on will end up going to Sony, and they know how to check this! But knowing them, they'll only tell us AFTER they fail the game. :D

Dark Star
August 23rd, 2007, 02:47 PM
Have you tried


aptitude show gcc

kcy29581
August 23rd, 2007, 02:50 PM
Have you tried


aptitude show gcc

I'll give that a go tomorrow, thanks.

LaRoza
August 23rd, 2007, 02:52 PM
I work for a games development company, and the game we're working on will end up going to Sony, and they know how to check this! But knowing them, they'll only tell us AFTER they fail the game. :D

Can you recompile?

kcy29581
August 23rd, 2007, 02:55 PM
Can you recompile?

I work on the testing side so I don't have the source code. I'm here to make sure the development teams don't screw up. If I asked them for verification, I know they'd just say "it's ok" without actually checking! :rolleyes:

Dark Star
August 23rd, 2007, 02:57 PM
I'll give that a go tomorrow, thanks.

Plz tell :) Pleasure helping :D Hope that helps :D

ghostdog74
August 23rd, 2007, 03:02 PM
if you are talking about:
gcc -v then I implore you to read the question before answering, especially when you are "trying" to patronise people.
The question was:

To put it even simply for you to understand, someone compiled an application, I need to verify they used a specific version of gcc; how do I do that?

even if its so, then change your search term ("how to determine compiler version")... here's the first result


strings - yourapplication | grep GCC

you can try that. btw, i don't patronise people. i just want them to be self sufficient.

kcy29581
August 23rd, 2007, 03:12 PM
even if its so, then change your search term ("how to determine compiler version")... here's the first result


strings - yourapplication | grep GCC

you can try that. btw, i don't patronise people. i just want them to be self sufficient.

sorry ghostdog74, but the tone of your replies was very similar to all the replies I've had in the office: RTFM; if I had the manual or knew which manual had the answer then I'd be fine reading away. I try to use the forums only as a last resort.

Thanks for the suggestion, I'll give it a shot.

kcy29581
August 23rd, 2007, 03:17 PM
SOLVED!

Thanks ghostdog74! You :guitar:

The command you suggested works like a charm!

Dark Star
August 23rd, 2007, 03:19 PM
What abt mine ? :?
shashwat@shashwat-desktop:~$ aptitude show gcc
Package: gcc
State: installed
Automatically installed: no
Version: 4:4.1.2-1ubuntu1
Priority: optional
Section: devel
Maintainer: Ubuntu Core developers <ubuntu-devel@lists.ubuntu.com>
Uncompressed Size: 65.5k
Depends: cpp (>= 4:4.1.2-1ubuntu1), gcc-4.1 (>= 4.1.2)
Recommends: libc6-dev | libc-dev
Suggests: make, manpages-dev, autoconf, automake1.9, libtool, flex, bison, gdb,
gcc-doc
Conflicts: gcc-doc (< 1:2.95.3)
Provides: c-compiler
Description: The GNU C compiler
This is the GNU C compiler, a fairly portable optimizing compiler for C.

This is a dependency package providing the default GNU C compiler.
This is my output :D

ghostdog74
August 23rd, 2007, 03:28 PM
if I had the manual or knew which manual had the answer then I'd be fine reading away. I try to use the forums only as a last resort.

first of all, glad that it worked for you.
second, i did not give you the answer. Google did. :)

kcy29581
August 23rd, 2007, 03:34 PM
first of all, glad that it worked for you.
second, i did not give you the answer. Google did. :)

Yeah, but Google gave it via you! :)

nanotube
August 23rd, 2007, 05:14 PM
What abt mine ? :?
shashwat@shashwat-desktop:~$ aptitude show gcc
Package: gcc
State: installed
Automatically installed: no
Version: 4:4.1.2-1ubuntu1
Priority: optional
Section: devel
Maintainer: Ubuntu Core developers <ubuntu-devel@lists.ubuntu.com>
Uncompressed Size: 65.5k
Depends: cpp (>= 4:4.1.2-1ubuntu1), gcc-4.1 (>= 4.1.2)
Recommends: libc6-dev | libc-dev
Suggests: make, manpages-dev, autoconf, automake1.9, libtool, flex, bison, gdb,
gcc-doc
Conflicts: gcc-doc (< 1:2.95.3)
Provides: c-compiler
Description: The GNU C compiler
This is the GNU C compiler, a fairly portable optimizing compiler for C.

This is a dependency package providing the default GNU C compiler.
This is my output :D

that just shows what version of gcc is available from the repositories. that does not answer the question of what version of gcc was used to compile some particular application.

Lster
August 23rd, 2007, 05:28 PM
That looks interesting... I will try that...