gcc4.4 build error on Centos7
Re: gcc4.4 build error on Centos7
And the answers to your questions are likely in the output from readelf but you need to find them.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: gcc4.4 build error on Centos7
My post right before yours had such details.vyshnav wrote:Can you please tell which version of gcc you are used for compiling.
That is scary size for a binary and very impressive strip.vyshnav wrote:Our binary which was compiled on centos 6 is of size 900MB. When i compile in Centos7 the binary size is 1.6GB. If i strip the binary, the resulting file is only 50MB ,this is the actual scenario.
How much does strip leave on the CentOS 6?
It should be easy to do the strip by default with the build tools.
Re: gcc4.4 build error on Centos7
can you please tell ,which option in readelf is increasing the size of executable? this start of section header will cause the size difference ?jlehtone wrote:Deja vu: viewtopic.php?f=47&t=64179
Lets play (the gcc-6.3 is from devtoolset-6):
# cat hello.cCode: Select all
#include <stdio.h> int main() { int foo = 42; printf( "%4d\n", foo ); return 0; }
Code: Select all
# cat /etc/centos-release CentOS Linux release 7.4.1708 (Core) # gcc --version gcc (GCC) 6.3.1 20170216 (Red Hat 6.3.1-3) # gcc -Os -Wall -Wextra -o foo-7-63 hello.c # gcc --version gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16) # gcc -Os -Wall -Wextra -o foo-7-48 hello.c # gcc44 --version gcc44 (GCC) 4.4.7 20120313 (Red Hat 4.4.7-8) # gcc44 -Os -Wall -Wextra -o foo-7-44 hello.c
Code: Select all
# cat /etc/centos-release CentOS release 6.9 (Final) # gcc --version gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) # gcc -Os -Wall -Wextra -o foo-6-44 hello.c # gcc --version gcc (GCC) 6.3.1 20170216 (Red Hat 6.3.1-3) # gcc -Os -Wall -Wextra -o foo-6-63 hello.c
Interestingly, the 6.3 produces same size on both platforms, but strips differently.Code: Select all
# ls -gG foo* -rwxr-xr-x. 1 6411 Oct 9 13:02 foo-6-44 -rwxr-xr-x. 1 8480 Oct 9 13:03 foo-6-63 -rwxr-xr-x. 1 8440 Oct 9 13:09 foo-7-44 -rwxr-xr-x. 1 8520 Oct 9 12:50 foo-7-48 -rwxr-xr-x. 1 8480 Oct 9 12:51 foo-7-63 # strip foo* # ls -gG foo* -rwxr-xr-x. 1 4232 Oct 9 13:04 foo-6-44 -rwxr-xr-x. 1 6272 Oct 9 13:04 foo-6-63 -rwxr-xr-x. 1 6272 Oct 9 13:09 foo-7-44 -rwxr-xr-x. 1 6240 Oct 9 12:55 foo-7-48 -rwxr-xr-x. 1 6344 Oct 9 12:55 foo-7-63
The 4.4 is smaller on C6 than C7, before and after stripping.
However, the object files save same size:Like TrevorH wrote, the compiler is innocent here.Code: Select all
C7# gcc44 -Os -Wall -Wextra -c hello.c C7# ls -gG hello.o -rw-r--r--. 1 1488 Oct 9 13:22 hello.o C6# gcc -Os -Wall -Wextra -c hello.c C6# ls -gG hello.o -rw-r--r--. 1 1488 Oct 9 13:23 hello.o
[edit]The Start of section headers is different between the two.Code: Select all
# readelf -h foo-6-44 ELF Header: Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: Advanced Micro Devices X86-64 Version: 0x1 Entry point address: 0x4003e0 Start of program headers: 64 (bytes into file) Start of section headers: 2440 (bytes into file) Flags: 0x0 Size of this header: 64 (bytes) Size of program headers: 56 (bytes) Number of program headers: 8 Size of section headers: 64 (bytes) Number of section headers: 28 Section header string table index: 27 # readelf -h foo-7-44 ELF Header: Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: Advanced Micro Devices X86-64 Version: 0x1 Entry point address: 0x400450 Start of program headers: 64 (bytes into file) Start of section headers: 4480 (bytes into file) Flags: 0x0 Size of this header: 64 (bytes) Size of program headers: 56 (bytes) Number of program headers: 9 Size of section headers: 64 (bytes) Number of section headers: 28 Section header string table index: 27
Re: gcc4.4 build error on Centos7
I don't speak Elvish. I just did read
man readelf
enough to get some output. Besides,
As TrevorH has written, it should be the linker that constructs the ELF binary.
It is the new linker that includes something new.
Something in the program headers, apparently.
The readelf might be able to tell what, but not why.
You did not tell how much strip reduces size on the other system of yours.
man readelf
enough to get some output. Besides,
readelf apparently reads, shows, displays.readelf - Displays information about ELF files.
As TrevorH has written, it should be the linker that constructs the ELF binary.
It is the new linker that includes something new.
Something in the program headers, apparently.
The readelf might be able to tell what, but not why.
You did not tell how much strip reduces size on the other system of yours.
Re: gcc4.4 build error on Centos7
Sorry i didnt understand first.jlehtone wrote:I don't speak Elvish. I just did read
man readelf
enough to get some output. Besides,readelf apparently reads, shows, displays.readelf - Displays information about ELF files.
As TrevorH has written, it should be the linker that constructs the ELF binary.
It is the new linker that includes something new.
Something in the program headers, apparently.
The readelf might be able to tell what, but not why.
You did not tell how much strip reduces size on the other system of yours.
this is the output I'm getting after striping in centos6
Re: gcc4.4 build error on Centos7
Do you really strip that to 4.2K?Our binary which was compiled on centos 6 is of size 900MB.
PS. Why do you post bitmaps? Images are larger than plain text.
Re: gcc4.4 build error on Centos7
Do you really strip that to 4.2K?jlehtone wrote:Our binary which was compiled on centos 6 is of size 900MB.
This is the output of "Helloworld" program , actuallly i dont want to strip in centos6 . When i compile in centos7 (gcc4.8) i should get a binary of size that is same as that of centos 6(gcc4.4)
Re: gcc4.4 build error on Centos7
You want to strip in centos 6. Not the used binary, but a temporary copy of it. You want to know the result, for listing differences between the system.vyshnav wrote:This is the output of "Helloworld" program , actuallly i dont want to strip in centos6 . When i compile in centos7 (gcc4.8) i should get a binary of size that is same as that of centos 6(gcc4.4)
Who says that CentOS 6 binaries should have same size as CentOS 7 binaries?
You would like to have same size.
The linker has rebased from 2.20 into 2.25:
Code: Select all
# rpm -qf $(which ld)
C6# rpm -q binutils
binutils-2.20.51.0.2-5.47.el6_9.1.x86_64
C7# rpm -qf /usr/bin/ld
binutils-2.25.1-32.base.el7_4.1.x86_64
Re: gcc4.4 build error on Centos7
I want to have same size in both centos 6 and centos 7jlehtone wrote:You want to strip in centos 6. Not the used binary, but a temporary copy of it. You want to know the result, for listing differences between the system.vyshnav wrote:This is the output of "Helloworld" program , actuallly i dont want to strip in centos6 . When i compile in centos7 (gcc4.8) i should get a binary of size that is same as that of centos 6(gcc4.4)
Who says that CentOS 6 binaries should have same size as CentOS 7 binaries?
You would like to have same size.
The linker has rebased from 2.20 into 2.25:Code: Select all
# rpm -qf $(which ld) C6# rpm -q binutils binutils-2.20.51.0.2-5.47.el6_9.1.x86_64 C7# rpm -qf /usr/bin/ld binutils-2.25.1-32.base.el7_4.1.x86_64
Re: gcc4.4 build error on Centos7
vyshnav wrote:I want to have same size in both centos 6 and centos 7jlehtone wrote:You want to strip in centos 6. Not the used binary, but a temporary copy of it. You want to know the result, for listing differences between the system.vyshnav wrote:This is the output of "Helloworld" program , actuallly i dont want to strip in centos6 . When i compile in centos7 (gcc4.8) i should get a binary of size that is same as that of centos 6(gcc4.4)
Who says that CentOS 6 binaries should have same size as CentOS 7 binaries?
You would like to have same size.
The linker has rebased from 2.20 into 2.25:Code: Select all
# rpm -qf $(which ld) C6# rpm -q binutils binutils-2.20.51.0.2-5.47.el6_9.1.x86_64 C7# rpm -qf /usr/bin/ld binutils-2.25.1-32.base.el7_4.1.x86_64
Can i replace this new binutils package with old to solve my issue?? is it reduce the size of binary ?