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

Fix an issue with library compilation on Macs #25844

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions compiler/codegen/library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,8 @@ static void printMakefileLibraries(fileinfo makefile, std::string name) {
fprintf(makefile.fptr, "%s", requires_.c_str());
}

//
// Append the Chapel library as the last linker argument. We do this as a
// stopgap to make the GNU linker happy.
//
removeTrailingNewlines(libraries);
fprintf(makefile.fptr, " %s %s\n\n", libraries.c_str(), libname.c_str());
fprintf(makefile.fptr, " %s\n\n", libraries.c_str());
}

// Helper to convert command lines flags from make syntax to CMake syntax
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -larrayArg_queriedDomain `$CHPL_HOME/util/config/compileline --libraries` -larrayArg_queriedDomain
-Llib/ -larrayArg_queriedDomain `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -larrayOpaquePointer `$CHPL_HOME/util/config/compileline --libraries` -larrayOpaquePointer
-Llib/ -larrayOpaquePointer `$CHPL_HOME/util/config/compileline --libraries`
2 changes: 1 addition & 1 deletion test/interop/C/exportArray/callCheckIfEmpty.lastcompopts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lcheckIfEmpty `$CHPL_HOME/util/config/compileline --libraries` -lcheckIfEmpty
-Llib/ -lcheckIfEmpty `$CHPL_HOME/util/config/compileline --libraries`
2 changes: 1 addition & 1 deletion test/interop/C/exportArray/callExported2Arg.lastcompopts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lexportFuncWith1Arr1Not `$CHPL_HOME/util/config/compileline --libraries` -lexportFuncWith1Arr1Not
-Llib/ -lexportFuncWith1Arr1Not `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lexportFuncWith1Not1Arr `$CHPL_HOME/util/config/compileline --libraries` -lexportFuncWith1Not1Arr
-Llib/ -lexportFuncWith1Not1Arr `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lexportFuncWith2Arrays `$CHPL_HOME/util/config/compileline --libraries` -lexportFuncWith2Arrays
-Llib/ -lexportFuncWith2Arrays `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lexportFuncWithArrayArg `$CHPL_HOME/util/config/compileline --libraries` -lexportFuncWithArrayArg
-Llib/ -lexportFuncWithArrayArg `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lexportFuncWithExplicitVoidRet `$CHPL_HOME/util/config/compileline --libraries` -lexportFuncWithExplicitVoidRet
-Llib/ -lexportFuncWithExplicitVoidRet `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lexportFuncWithRealArr `$CHPL_HOME/util/config/compileline --libraries` -lexportFuncWithRealArr
-Llib/ -lexportFuncWithRealArr `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lexportFuncWithExternType `$CHPL_HOME/util/config/compileline --libraries` -lexportFuncWithExternType
-Llib/ -lexportFuncWithExternType `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lexportFuncWithPtr `$CHPL_HOME/util/config/compileline --libraries` -lexportFuncWithPtr
-Llib/ -lexportFuncWithPtr `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreturnExternArray `$CHPL_HOME/util/config/compileline --libraries` -lreturnExternArray
-Llib/ -lreturnExternArray `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lwrapArrayAsOpaque_global `$CHPL_HOME/util/config/compileline --libraries` -lwrapArrayAsOpaque_global
-Llib/ -lwrapArrayAsOpaque_global `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lwrapArrayAsOpaque_moreComplex `$CHPL_HOME/util/config/compileline --libraries` -lwrapArrayAsOpaque_moreComplex
-Llib/ -lwrapArrayAsOpaque_moreComplex `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lexportArrArgReturnInt `$CHPL_HOME/util/config/compileline --libraries` -lexportArrArgReturnInt
-Llib/ -lexportArrArgReturnInt `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreturnArray `$CHPL_HOME/util/config/compileline --libraries` -lreturnArray
-Llib/ -lreturnArray `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreturnArrayGenericDecl `$CHPL_HOME/util/config/compileline --libraries` -lreturnArrayGenericDecl
-Llib/ -lreturnArrayGenericDecl `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreturnArrayGenericDecl2 `$CHPL_HOME/util/config/compileline --libraries` -lreturnArrayGenericDecl2
-Llib/ -lreturnArrayGenericDecl2 `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreturnArrayOfReals `$CHPL_HOME/util/config/compileline --libraries` -lreturnArrayOfReals
-Llib/ -lreturnArrayOfReals `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreturnArrayTakesArg `$CHPL_HOME/util/config/compileline --libraries` -lreturnArrayTakesArg
-Llib/ -lreturnArrayTakesArg `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreturnArrayTakesArg2 `$CHPL_HOME/util/config/compileline --libraries` -lreturnArrayTakesArg2
-Llib/ -lreturnArrayTakesArg2 `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreturnArrayTakesArrayArg `$CHPL_HOME/util/config/compileline --libraries` -lreturnArrayTakesArrayArg
-Llib/ -lreturnArrayTakesArrayArg `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreturnArrayTakesArrayArg2 `$CHPL_HOME/util/config/compileline --libraries` -lreturnArrayTakesArrayArg2
-Llib/ -lreturnArrayTakesArrayArg2 `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreturnArrayTakesArrayArg3 `$CHPL_HOME/util/config/compileline --libraries` -lreturnArrayTakesArrayArg3
-Llib/ -lreturnArrayTakesArrayArg3 `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreturnArrayTakesArrayArg4 `$CHPL_HOME/util/config/compileline --libraries` -lreturnArrayTakesArrayArg4
-Llib/ -lreturnArrayTakesArrayArg4 `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreturnBadArray `$CHPL_HOME/util/config/compileline --libraries` -lreturnBadArray
-Llib/ -lreturnBadArray `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreturnBadArray2 `$CHPL_HOME/util/config/compileline --libraries` -lreturnBadArray2
-Llib/ -lreturnBadArray2 `$CHPL_HOME/util/config/compileline --libraries`
2 changes: 1 addition & 1 deletion test/interop/C/externRecords/sendExternRecord.lastcompopts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreceiveExternRecord `$CHPL_HOME/util/config/compileline --libraries` -lreceiveExternRecord
-Llib/ -lreceiveExternRecord `$CHPL_HOME/util/config/compileline --libraries`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreliesOnGlobal `$CHPL_HOME/util/config/compileline --libraries` -lreliesOnGlobal
-Llib/ -lreliesOnGlobal `$CHPL_HOME/util/config/compileline --libraries`
2 changes: 1 addition & 1 deletion test/interop/C/globals/use_reliesOnGlobal.lastcompopts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lreliesOnGlobal `$CHPL_HOME/util/config/compileline --libraries` -lreliesOnGlobal
-Llib/ -lreliesOnGlobal `$CHPL_HOME/util/config/compileline --libraries`
2 changes: 1 addition & 1 deletion test/interop/C/noLibFlag/callDirSet.lastcompopts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Lmydir/ -lsetDir `$CHPL_HOME/util/config/compileline --libraries` -lsetDir
-Lmydir/ -lsetDir `$CHPL_HOME/util/config/compileline --libraries`
2 changes: 1 addition & 1 deletion test/interop/C/use_PtrConstQualifier.lastcompopts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -lPtrConstQualifier `$CHPL_HOME/util/config/compileline --libraries` -lPtrConstQualifier
-Llib/ -lPtrConstQualifier `$CHPL_HOME/util/config/compileline --libraries`
2 changes: 1 addition & 1 deletion test/interop/C/use_testing.lastcompopts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Llib/ -ltesting `$CHPL_HOME/util/config/compileline --libraries` -ltesting
-Llib/ -ltesting `$CHPL_HOME/util/config/compileline --libraries`