Disable link maps by default and fix compile issue with lld linker

The link maps were actually disabled by default before
912f1d5cec, and required KICAD_MAKE_LINK_MAPS
to be provided to enable them. So switch back to disabling them by
default.

Also, The lld linker is unable to accept a single dash cref option, while
ld and gold can. Instead, use the double dash version that is supported
by all three.

xref: https://github.com/llvm/llvm-project/issues/60932

Co-authored-by: aris-kimi <aris_kimi@hotmail.com>
Co-authored-by: Ian McInerney <ian.s.mcinerney@ieee.org>
This commit is contained in:
aris-kimi 2023-02-23 00:17:51 +02:00 committed by Ian McInerney
parent 04165b22d1
commit 22bca5c2a0
9 changed files with 14 additions and 14 deletions

View File

@ -189,7 +189,7 @@ cmake_dependent_option( KICAD_WIN32_BUILD_PARALLEL_CL_MP
# Advanced option to make link maps (only available on linux) # Advanced option to make link maps (only available on linux)
cmake_dependent_option( KICAD_MAKE_LINK_MAPS cmake_dependent_option( KICAD_MAKE_LINK_MAPS
"Create link maps for artifacts" "Create link maps for artifacts"
ON "UNIX_NOT_APPLE" OFF "UNIX_NOT_APPLE"
OFF ) OFF )
mark_as_advanced( KICAD_MAKE_LINK_MAPS ) mark_as_advanced( KICAD_MAKE_LINK_MAPS )

View File

@ -94,6 +94,6 @@ endif()
if( false ) # linker map with cross reference if( false ) # linker map with cross reference
set_target_properties( bitmap2component PROPERTIES set_target_properties( bitmap2component PROPERTIES
LINK_FLAGS "-Wl,-cref,-Map=bitmap2component.map" LINK_FLAGS "-Wl,--cref,-Map=bitmap2component.map"
) )
endif() endif()

View File

@ -93,7 +93,7 @@ set_source_files_properties( cvpcb.cpp PROPERTIES
) )
target_link_options( cvpcb_kiface PRIVATE target_link_options( cvpcb_kiface PRIVATE
$<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,-cref,-Map=_cvpcb.kiface.map> $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=_cvpcb.kiface.map>
) )
# these 2 binaries are a matched set, keep them together: # these 2 binaries are a matched set, keep them together:

View File

@ -527,10 +527,10 @@ add_dependencies( eeschema eeschema_kiface )
# Generate link map with cross reference # Generate link map with cross reference
target_link_options( eeschema_kiface PRIVATE target_link_options( eeschema_kiface PRIVATE
$<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,-cref,-Map=${KIFACE_PREFIX}eeschema${KIFACE_SUFFIX}.map> $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=${KIFACE_PREFIX}eeschema${KIFACE_SUFFIX}.map>
) )
target_link_options( eeschema PRIVATE target_link_options( eeschema PRIVATE
$<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,-cref,-Map=eeschema.map> $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=eeschema.map>
) )
# these 2 binaries are a matched set, keep them together: # these 2 binaries are a matched set, keep them together:

View File

@ -121,7 +121,7 @@ target_include_directories( gerbview PRIVATE
) )
target_link_options( gerbview PRIVATE target_link_options( gerbview PRIVATE
$<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,-cref,-Map=gerbview.map> $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=gerbview.map>
) )
# The objects for the main gerbview program # The objects for the main gerbview program
@ -163,7 +163,7 @@ set_source_files_properties( gerbview.cpp PROPERTIES
) )
target_link_options( gerbview_kiface PRIVATE target_link_options( gerbview_kiface PRIVATE
$<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,-cref,-Map=_gerbview.kiface.map> $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=_gerbview.kiface.map>
) )
# if building gerbview, then also build gerbview_kiface if out of date. # if building gerbview, then also build gerbview_kiface if out of date.

View File

@ -89,7 +89,7 @@ target_link_libraries( pl_editor
) )
target_link_options( pl_editor PRIVATE target_link_options( pl_editor PRIVATE
$<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,-cref,-Map=pl_editor.map> $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=pl_editor.map>
) )
# the main pl_editor program, in DSO form. # the main pl_editor program, in DSO form.
@ -120,7 +120,7 @@ set_source_files_properties( pl_editor.cpp PROPERTIES
) )
target_link_options( pl_editor_kiface PRIVATE target_link_options( pl_editor_kiface PRIVATE
$<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,-cref,-Map=_pl_editor.kiface.map> $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=_pl_editor.kiface.map>
) )
# if building pl_editor, then also build pl_editor_kiface if out of date. # if building pl_editor, then also build pl_editor_kiface if out of date.

View File

@ -93,7 +93,7 @@ target_link_libraries( pcb_calculator
) )
target_link_options( pcb_calculator PRIVATE target_link_options( pcb_calculator PRIVATE
$<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,-cref,-Map=pcb_calculator.map> $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=pcb_calculator.map>
) )
# the main pcb_calculator program, in DSO form. # the main pcb_calculator program, in DSO form.
@ -118,7 +118,7 @@ set_source_files_properties( pcb_calculator.cpp PROPERTIES
) )
target_link_options( pcb_calculator_kiface PRIVATE target_link_options( pcb_calculator_kiface PRIVATE
$<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,-cref,-Map=_pcb_calculator.kiface.map> $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=_pcb_calculator.kiface.map>
) )
# if building pcb_calculator, then also build pcb_calculator_kiface if out of date. # if building pcb_calculator, then also build pcb_calculator_kiface if out of date.

View File

@ -604,7 +604,7 @@ target_link_libraries( pcbnew
) )
target_link_options( pcbnew PRIVATE target_link_options( pcbnew PRIVATE
$<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,-cref,-Map=pcbnew.map> $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=pcbnew.map>
) )
# the main pcbnew program, in DSO form. # the main pcbnew program, in DSO form.
@ -697,7 +697,7 @@ set_source_files_properties( pcbnew.cpp PROPERTIES
) )
target_link_options( pcbnew_kiface PRIVATE target_link_options( pcbnew_kiface PRIVATE
$<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,-cref,-Map=_pcbnew.kiface.map> $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=_pcbnew.kiface.map>
) )
# if building pcbnew, then also build pcbnew_kiface if out of date. # if building pcbnew, then also build pcbnew_kiface if out of date.

View File

@ -62,7 +62,7 @@ set_target_properties( scripting_kiface PROPERTIES
) )
target_link_options( scripting_kiface PRIVATE target_link_options( scripting_kiface PRIVATE
$<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,-cref,-Map=_scripting.kiface.map> $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=_scripting.kiface.map>
) )
if( APPLE ) if( APPLE )