--- ctypes_configure/configure.py
+++ ctypes_configure/configure.py
@@ -567,11 +567,11 @@
     printf("%s: %d\\n", key, value);
 }
 """
 
 def run_example_code(filepath, eci, noerr=False):
-    executable = build_executable([filepath], eci, noerr=noerr)
+    executable = build_executable([filepath], eci, compiler_exe=os.getenv('PYPY_CC'), noerr=noerr)
     output = py.process.cmdexec(executable)
     section = None
     for line in output.splitlines():
         line = line.strip()
         if line.startswith('-+- '):      # start of a new section
