Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
2967f01e
Commit
2967f01e
authored
Dec 06, 2021
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
param: Add a new cc_warnings parameter
With a new %w expansion in the cc_command parameter.
parent
f985e15c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
5 deletions
+39
-5
mgt.h
bin/varnishd/mgt/mgt.h
+1
-0
mgt_vcc.c
bin/varnishd/mgt/mgt_vcc.c
+4
-0
c00109.vtc
bin/varnishtest/tests/c00109.vtc
+9
-0
configure.ac
configure.ac
+11
-4
params.h
include/tbl/params.h
+14
-1
No files found.
bin/varnishd/mgt/mgt.h
View file @
2967f01e
...
...
@@ -233,6 +233,7 @@ void mgt_vcl_startup(struct cli *, const char *vclsrc, const char *origin,
int
mgt_push_vcls
(
struct
cli
*
,
unsigned
*
status
,
char
**
p
);
const
char
*
mgt_has_vcl
(
void
);
extern
char
*
mgt_cc_cmd
;
extern
char
*
mgt_cc_warn
;
extern
const
char
*
mgt_vcl_path
;
extern
const
char
*
mgt_vmod_path
;
#define MGT_VCC(t, n, cc) extern t mgt_vcc_ ## n;
...
...
bin/varnishd/mgt/mgt_vcc.c
View file @
2967f01e
...
...
@@ -63,6 +63,7 @@ struct vcc_priv {
};
char
*
mgt_cc_cmd
;
char
*
mgt_cc_warn
;
const
char
*
mgt_vcl_path
;
const
char
*
mgt_vmod_path
;
#define MGT_VCC(t, n, cc) t mgt_vcc_ ## n;
...
...
@@ -150,6 +151,9 @@ run_cc(void *priv)
case
'o'
:
VSB_cat
(
sb
,
VGC_LIB
);
break
;
case
'w'
:
VSB_cat
(
sb
,
mgt_cc_warn
);
break
;
case
'%'
:
VSB_putc
(
sb
,
'%'
);
break
;
...
...
bin/varnishtest/tests/c00109.vtc
0 → 100644
View file @
2967f01e
varnishtest "cc_command and cc_warnings"
varnish v1 -cliok {param.set debug +vcl_keep}
varnish v1 -cliok {param.set cc_command "! printf '%w' >world"}
varnish v1 -cliok {param.set cc_warnings hello}
varnish v1 -errvcl "VCL compilation failed" "backend be none;"
shell -expect hello "cat v1/vcl_*/world"
configure.ac
View file @
2967f01e
...
...
@@ -806,26 +806,33 @@ else
*-*-solaris*)
case $PTHREAD_CC in
*gcc*)
VCC_CC="$PTHREAD_CC $OCFLAGS
$WFLAGS
$PTHREAD_CFLAGS -fpic -shared -o %o %s"
VCC_CC="$PTHREAD_CC $OCFLAGS
%w
$PTHREAD_CFLAGS -fpic -shared -o %o %s"
break
;;
*cc)
VCC_CC="$PTHREAD_CC $OCFLAGS
$WFLAGS
-errwarn=%all,no%E_STATEMENT_NOT_REACHED $PTHREAD_CFLAGS -Kpic -G -o %o %s"
VCC_CC="$PTHREAD_CC $OCFLAGS
%w
-errwarn=%all,no%E_STATEMENT_NOT_REACHED $PTHREAD_CFLAGS -Kpic -G -o %o %s"
;;
esac
;;
*-*-darwin*)
VCC_CC="exec cc $OCFLAGS
$WFLAGS
-dynamiclib -Wl,-undefined,dynamic_lookup -o %o %s"
VCC_CC="exec cc $OCFLAGS
%w
-dynamiclib -Wl,-undefined,dynamic_lookup -o %o %s"
;;
*)
VCC_CC="exec $PTHREAD_CC $OCFLAGS
$WFLAGS
$PTHREAD_CFLAGS $SAN_CFLAGS -fpic -shared -Wl,-x -o %o %s"
VCC_CC="exec $PTHREAD_CC $OCFLAGS
%w
$PTHREAD_CFLAGS $SAN_CFLAGS -fpic -shared -Wl,-x -o %o %s"
;;
esac
fi
if test "$ac_cv_env_VCC_WARN_set" = set; then
VCC_WARN=$ac_cv_env_VCC_WARN_value
else
VCC_WARN=$WFLAGS
fi
OCFLAGS="$OCFLAGS $WFLAGS"
AC_DEFINE_UNQUOTED([VCC_CC],"$VCC_CC",[C compiler command line for VCL code])
AC_DEFINE_UNQUOTED([VCC_WARN],"$VCC_WARN",[C compiler warnings for VCL code])
# Stupid automake needs this
VTC_TESTS="$(cd $srcdir/bin/varnishtest && echo tests/*.vtc)"
...
...
include/tbl/params.h
View file @
2967f01e
...
...
@@ -1533,7 +1533,20 @@ PARAM_STRING(
"Command used for compiling the C source code to a "
"dlopen(3) loadable object. Any occurrence of %s in "
"the string will be replaced with the source file name, "
"and %o will be replaced with the output file name."
,
"%o will be replaced with the output file name, and %w "
"will be replaced by the cc_warnings parameter."
,
/* flags */
MUST_RELOAD
)
PARAM_STRING
(
/* name */
cc_warnings
,
/* tweak */
tweak_string
,
/* priv */
&
mgt_cc_warn
,
/* def */
VCC_WARN
,
/* descr */
"Warnings used when compiling the C source code with "
"the cc_command parameter. By default, VCL is compiled "
"with the same set of warnings as Varnish itself."
,
/* flags */
MUST_RELOAD
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment