Commit 6746979
compilers: clike: Deduplicate compile and link args from actually used arg list
Current behaviour is to loop over 'sys_args' list which contains both
included and ignored compiler arguments.
This could produce unexpected results when argument is both ignored and
deduplicated.
With the following changes, 'cleaned_sys_args' is used to ensure only
included args are deduplicated.
Example:
CFLAGS (or 'c_args' as Meson option) has '-I${includedir} -L${libdir}'
and LDFLAGS ('c_link_args') has '-L${libdir}'.
Given CFLAGS value is wrong: -L entry belongs to LDFLAGS and thus should
not be included in compiler argument list.
Since we have -L in 'sys_args' list this entry will not be included as
linker flag too!
This is definitely not our goal: wrong entry should just be ignored.
Some debug prints from Meson:
C_ARGS: ['-I/opt/x64-compile/include', '-L/opt/x64-compile/lib']
LINKER_ARGS: ['-L/opt/x64-compile/lib']
RESULT_CARGS: ['-I/opt/x64-compile/include', '-D_FILE_OFFSET_BITS=64']
RESULT_LDARGS: []
(this is captured during compiler.find_library() call)
And this is what we see after applying patch:
C_ARGS: ['-I/opt/x64-compile/include', '-L/opt/x64-compile/lib']
LINKER_ARGS: ['-L/opt/x64-compile/lib']
RESULT_CARGS: ['-I/opt/x64-compile/include', '-D_FILE_OFFSET_BITS=64']
RESULT_LDARGS: ['-L/opt/x64-compile/lib']1 parent c8a7fd7 commit 6746979
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
| 388 | + | |
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| |||
0 commit comments