tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Assembling with as(1) from cwrappers



			Hi tech-pkg@, Joerg,

I notice that in cwrappers, bin/normalise-cc.c is compiled in the
wrapper for as(1) without modification. However, it defaults to building
executables:

>  63 void
>  64 operation_mode_cc(struct arglist *args)
>  65 { [...]
>  68         current_operation_mode = mode_link_executable;
>  69         TAILQ_FOREACH(arg, args, link) {
>  70                 if (arg->val[0] != '-')
>  71                         continue; [...]
>  76                 if (strcmp(arg->val, "-S") == 0) {
>  77                         current_operation_mode = mode_assemble;
>  78                         continue;
>  79                 }
>  80                 if (strcmp(arg->val, "-c") == 0) {
>  81                         current_operation_mode = mode_compile;
>  82                         continue;
>  83                 }

Trouble is, as(1) really creates objects, which should consider
current_operation_mode to be mode_compile or mode_assemble instead of
the default mode_executable here. as(1) does not expect "-c" nor any
linking flags, which it currently gets if PKGSRC_MKPIE is enabled for
instance (via append_executable).

@Joerg: can you confirm this issue?

I could not come up with a tentative fix yet, but feel free to beat me
to it. To reproduce the issue, it is currently not possible to build
lang/g95 in pkgsrc with PKGSRC_MKPIE=yes:

path/to/wrapper/as -Qy -o libgcc/./_muldi3.o /var/tmp//ccHO3hQm.s

fails to build because it does not know "-pie".

This package also fails to build without cwrappers for a different
reason, when PKGSRC_MKPIE is enabled (missing -fPIC for ggc-page.o).

Cheers,
-- 
khorben



Home | Main Index | Thread Index | Old Index