bfe950
link mode: import library generation: added mdso support.
@@ -826,8 +826,9 @@ static int slbt_exec_link_create_import_library(
|
|
826
826
|
char * soname,
|
827
827
|
bool ftag)
|
828
828
|
{
|
829
|
+
int fmdso;
|
829
830
|
char * slash;
|
830
|
-
char *
|
831
|
+
char * eargv[8];
|
831
832
|
char program[PATH_MAX];
|
832
833
|
char hosttag[PATH_MAX];
|
833
834
|
char hostlnk[PATH_MAX];
|
@@ -866,22 +867,49 @@ static int slbt_exec_link_create_import_library(
|
|
866
867
|
return SLBT_NESTED_ERROR(dctx);
|
867
868
|
}
|
868
869
|
|
869
|
-
/* dlltool
|
870
|
-
if
|
871
|
-
|
872
|
-
|
870
|
+
/* dlltool or mdso? */
|
871
|
+
if (dctx->cctx->drvflags & SLBT_DRIVER_IMPLIB_DSOMETA)
|
872
|
+
fmdso = 1;
|
873
|
+
|
874
|
+
else if (dctx->cctx->drvflags & SLBT_DRIVER_IMPLIB_DSOMETA)
|
875
|
+
fmdso = 0;
|
876
|
+
|
877
|
+
else if (!(strcmp(dctx->cctx->host.flavor,"midipix")))
|
878
|
+
fmdso = 1;
|
879
|
+
|
880
|
+
else
|
881
|
+
fmdso = 0;
|
873
882
|
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
883
|
+
/* eargv */
|
884
|
+
if (fmdso) {
|
885
|
+
if ((size_t)snprintf(program,sizeof(program),"%s",
|
886
|
+
dctx->cctx->host.mdso) >= sizeof(program))
|
887
|
+
return SLBT_BUFFER_ERROR(dctx);
|
888
|
+
|
889
|
+
eargv[0] = program;
|
890
|
+
eargv[1] = "-i";
|
891
|
+
eargv[2] = impfilename;
|
892
|
+
eargv[3] = "-n";
|
893
|
+
eargv[4] = soname;
|
894
|
+
eargv[5] = deffilename;
|
895
|
+
eargv[6] = 0;
|
896
|
+
} else {
|
897
|
+
if ((size_t)snprintf(program,sizeof(program),"%s",
|
898
|
+
dctx->cctx->host.dlltool) >= sizeof(program))
|
899
|
+
return SLBT_BUFFER_ERROR(dctx);
|
900
|
+
|
901
|
+
eargv[0] = program;
|
902
|
+
eargv[1] = "-l";
|
903
|
+
eargv[2] = impfilename;
|
904
|
+
eargv[3] = "-d";
|
905
|
+
eargv[4] = deffilename;
|
906
|
+
eargv[5] = "-D";
|
907
|
+
eargv[6] = soname;
|
908
|
+
eargv[7] = 0;
|
909
|
+
}
|
882
910
|
|
883
911
|
/* alternate argument vector */
|
884
|
-
ectx->argv =
|
912
|
+
ectx->argv = eargv;
|
885
913
|
ectx->program = program;
|
886
914
|
|
887
915
|
/* step output */
|
@@ -889,7 +917,7 @@ static int slbt_exec_link_create_import_library(
|
|
889
917
|
if (slbt_output_link(dctx,ectx))
|
890
918
|
return SLBT_NESTED_ERROR(dctx);
|
891
919
|
|
892
|
-
/* dlltool spawn */
|
920
|
+
/* dlltool/mdso spawn */
|
893
921
|
if ((slbt_spawn(ectx,true) < 0) || ectx->exitcode)
|
894
922
|
return SLBT_SPAWN_ERROR(dctx);
|
895
923
|
|