Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker commands that use c or c++ compiler should apply CFLAGS and CXXFLAGS respectively [CORE3606] #3960

Closed
firebird-automations opened this issue Sep 22, 2011 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Mariusz Zynel (mariusz)

After conffigure is run I have the following in make.defaults:

#⁠ LINKER COMMANDS

LIB_LINK:= CC $(GLOB_OPTIONS)
STATICLIB_LINK:= ar cruvs
CLIENTLIB_LINK:= cc -xc99=all $(GLOB_OPTIONS)
EXE_LINK:= CC $(GLOB_OPTIONS)
STATICEXE_LINK:= CC $(GLOB_OPTIONS)

The problem is that both cc and CC assume -m32 memory model by default and when building 64bit binaries linker ld tries to generate 32bit object off 64bit objects. The following is reported:

ld: fatal: file ../temp/boot/jrd/dsc.o: wrong ELF class: ELFCLASS64

and the compilation breaks.

It can be easily fixed by the following change in make.defaults:

LIB_LINK:= CC $(GLOB_OPTIONS) $(CXXFLAGS)
CLIENTLIB_LINK:= cc -xc99=all $(GLOB_OPTIONS) $(CFLAGS)
EXE_LINK:= CC $(GLOB_OPTIONS) $(CXXFLAGS)
STATICEXE_LINK:= CC $(GLOB_OPTIONS) $(CXXFLAGS)

Commits: f8f918d ef11481

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

summary: Linker commands that use cc or CC should apply CFLAGS and CXXFLAGS respectively => Linker commands that use c or c++ compiler should apply CFLAGS and CXXFLAGS respectively

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

Fix Version: 2.5.2 [ 10450 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: Cannot be tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment