mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
gas: make NO_LISTING work again
Presumably since no target enables this and there's also no configure control, builds with NO_LISTING defined didn't really work anymore. Convert fallback functions to macros and add #ifndef in a few places. (Behavior is different for affected command line options vs directives: The former are rejected as unrecognized, while the latter are silently ignored. I think that's fair enough.)
This commit is contained in:
8
gas/as.c
8
gas/as.c
@@ -469,10 +469,12 @@ parse_args (int * pargc, char *** pargv)
|
|||||||
OPTION_EMULATION,
|
OPTION_EMULATION,
|
||||||
OPTION_DEBUG_PREFIX_MAP,
|
OPTION_DEBUG_PREFIX_MAP,
|
||||||
OPTION_DEFSYM,
|
OPTION_DEFSYM,
|
||||||
|
#ifndef NO_LISTING
|
||||||
OPTION_LISTING_LHS_WIDTH,
|
OPTION_LISTING_LHS_WIDTH,
|
||||||
OPTION_LISTING_LHS_WIDTH2, /* = STD_BASE + 10 */
|
OPTION_LISTING_LHS_WIDTH2, /* = STD_BASE + 10 */
|
||||||
OPTION_LISTING_RHS_WIDTH,
|
OPTION_LISTING_RHS_WIDTH,
|
||||||
OPTION_LISTING_CONT_LINES,
|
OPTION_LISTING_CONT_LINES,
|
||||||
|
#endif
|
||||||
OPTION_DEPFILE,
|
OPTION_DEPFILE,
|
||||||
OPTION_GSTABS,
|
OPTION_GSTABS,
|
||||||
OPTION_GSTABS_PLUS,
|
OPTION_GSTABS_PLUS,
|
||||||
@@ -573,10 +575,12 @@ parse_args (int * pargc, char *** pargv)
|
|||||||
ports use -k to enable PIC assembly. */
|
ports use -k to enable PIC assembly. */
|
||||||
,{"keep-locals", no_argument, NULL, 'L'}
|
,{"keep-locals", no_argument, NULL, 'L'}
|
||||||
,{"keep-locals", no_argument, NULL, 'L'}
|
,{"keep-locals", no_argument, NULL, 'L'}
|
||||||
|
#ifndef NO_LISTING
|
||||||
,{"listing-lhs-width", required_argument, NULL, OPTION_LISTING_LHS_WIDTH}
|
,{"listing-lhs-width", required_argument, NULL, OPTION_LISTING_LHS_WIDTH}
|
||||||
,{"listing-lhs-width2", required_argument, NULL, OPTION_LISTING_LHS_WIDTH2}
|
,{"listing-lhs-width2", required_argument, NULL, OPTION_LISTING_LHS_WIDTH2}
|
||||||
,{"listing-rhs-width", required_argument, NULL, OPTION_LISTING_RHS_WIDTH}
|
,{"listing-rhs-width", required_argument, NULL, OPTION_LISTING_RHS_WIDTH}
|
||||||
,{"listing-cont-lines", required_argument, NULL, OPTION_LISTING_CONT_LINES}
|
,{"listing-cont-lines", required_argument, NULL, OPTION_LISTING_CONT_LINES}
|
||||||
|
#endif
|
||||||
,{"MD", required_argument, NULL, OPTION_DEPFILE}
|
,{"MD", required_argument, NULL, OPTION_DEPFILE}
|
||||||
,{"mri", no_argument, NULL, 'M'}
|
,{"mri", no_argument, NULL, 'M'}
|
||||||
,{"nocpp", no_argument, NULL, OPTION_NOCPP}
|
,{"nocpp", no_argument, NULL, OPTION_NOCPP}
|
||||||
@@ -918,6 +922,7 @@ This program has absolutely no warranty.\n"));
|
|||||||
flag_keep_locals = 1;
|
flag_keep_locals = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifndef NO_LISTING
|
||||||
case OPTION_LISTING_LHS_WIDTH:
|
case OPTION_LISTING_LHS_WIDTH:
|
||||||
listing_lhs_width = atoi (optarg);
|
listing_lhs_width = atoi (optarg);
|
||||||
if (listing_lhs_width_second < listing_lhs_width)
|
if (listing_lhs_width_second < listing_lhs_width)
|
||||||
@@ -937,6 +942,7 @@ This program has absolutely no warranty.\n"));
|
|||||||
case OPTION_LISTING_CONT_LINES:
|
case OPTION_LISTING_CONT_LINES:
|
||||||
listing_lhs_cont_lines = atoi (optarg);
|
listing_lhs_cont_lines = atoi (optarg);
|
||||||
break;
|
break;
|
||||||
|
#endif /* NO_LISTING */
|
||||||
|
|
||||||
case 'M':
|
case 'M':
|
||||||
flag_mri = 1;
|
flag_mri = 1;
|
||||||
@@ -1382,7 +1388,9 @@ gas_init (void)
|
|||||||
int
|
int
|
||||||
main (int argc, char ** argv)
|
main (int argc, char ** argv)
|
||||||
{
|
{
|
||||||
|
#ifndef NO_LISTING
|
||||||
char ** argv_orig = argv;
|
char ** argv_orig = argv;
|
||||||
|
#endif
|
||||||
struct stat sob;
|
struct stat sob;
|
||||||
|
|
||||||
gas_early_init (&argc, &argv);
|
gas_early_init (&argc, &argv);
|
||||||
|
|||||||
@@ -1658,58 +1658,4 @@ listing_source_file (const char *file)
|
|||||||
listing_tail->hll_file = file_info (file);
|
listing_tail->hll_file = file_info (file);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* Dummy functions for when compiled without listing enabled. */
|
|
||||||
|
|
||||||
void
|
|
||||||
listing_list (int on)
|
|
||||||
{
|
|
||||||
s_ignore (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
listing_eject (int ignore)
|
|
||||||
{
|
|
||||||
s_ignore (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
listing_psize (int ignore)
|
|
||||||
{
|
|
||||||
s_ignore (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
listing_nopage (int ignore)
|
|
||||||
{
|
|
||||||
s_ignore (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
listing_title (int depth)
|
|
||||||
{
|
|
||||||
s_ignore (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
listing_file (const char *name)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
listing_newline (char *name)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
listing_source_line (unsigned int n)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
listing_source_file (const char *n)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -58,6 +58,18 @@ void listing_title (int depth);
|
|||||||
void listing_warning (const char *message);
|
void listing_warning (const char *message);
|
||||||
void listing_width (unsigned int x);
|
void listing_width (unsigned int x);
|
||||||
|
|
||||||
|
#ifdef NO_LISTING
|
||||||
|
#define listing_list s_ignore
|
||||||
|
#define listing_eject s_ignore
|
||||||
|
#define listing_psize s_ignore
|
||||||
|
#define listing_nopage s_ignore
|
||||||
|
#define listing_title s_ignore
|
||||||
|
#define listing_file(name) ((void)(name))
|
||||||
|
#define listing_newline(ps) ((void)(ps))
|
||||||
|
#define listing_source_file(file) ((void)(file))
|
||||||
|
#define listing_source_line(line) ((void)(line))
|
||||||
|
#endif
|
||||||
|
|
||||||
extern int listing_lhs_width;
|
extern int listing_lhs_width;
|
||||||
extern int listing_lhs_width_second;
|
extern int listing_lhs_width_second;
|
||||||
extern int listing_lhs_cont_lines;
|
extern int listing_lhs_cont_lines;
|
||||||
|
|||||||
Reference in New Issue
Block a user